Lambert's low free kick six minutes from time took two deflections but Rovers, who knocked out Premier League Fulham in the third round and earlier had a Lambert header disallowed for a push, were well worth their home victory.
Lambert, celebrating his 26th birthday on Saturday, provided the highlight in a game that was short of chances as Rovers reached the quarter-finals for the first time in 50 years.
The stand-out game of the round takes place later on Saturday (5:15 p.m.) when Manchester United and Arsenal, the two most successful clubs in FA Cup history, meet at Old Trafford.
There are four other matches on Saturday, including holders Chelsea against Huddersfield, with a further two on Sunday.
(Reporting by Mitch Phillips, Editing by Trevor Huggins)