The England midfielder, restored to the starting XI ahead of Wednesday's Europa League final, cancelled out Christian Benteke's opener with a sweet left-footed effort just after the hour mark before sealing the points - and the record - with close-range effort three minutes from time.
That left him with 203 career goals for the Blues, a fitting landmark forged over 12 years at Stamford Bridge as he broke Bobby Tambling's club record.
How many more he will be able to add is open to question, with no contract extension yet signed, but the affection in which he is held by both team-mates and fans was clear in the ecstatic celebrations that followed his second goal.
Victory in a dramatic match that saw both Ramires and Benteke sent off for two yellow cards effectively assures Chelsea's Champions League status next season, while leaving Villa still in the relegation equation.
The first half had been such a different story, Villa ending it 1-0 up and with a man advantage.
Villa fashioned a neat passing move in the second minute, building from the back and gaining momentum when Fabian Delph powered past Ramires in midfield.
But they took one too many touches around the box and a shot on goal never materialised.
Nathan Baker was handed a yellow card in the fourth minute after going in hard on Juan Mata, but that did not curb Villa's combative streak as a number of full-blooded challenges went in.
Benteke was proving his usual handful in attack too, winning nearly everything in the air, and it was no surprise to see him on the scoresheet in the 15th minute.
He beat Gary Cahill to a Brad Guzan clearance and then peeled off at speed to take Yacouba Sylla's return pass.
The Belgian then glided past Cahill with ball at feet and slipped his shot past Petr Cech at the near post.
Villa had the bit between their teeth and Delph almost added a second two minutes later when he rode Ramires' challenge and shot just wide from 25 yards.
By the time the customary applause for retiring captain Stiliyan Petrov, who continues his battle with leukemia, arrived in the 19th minute, the home side were well on top.
Demba Ba almost spoiled the party when he got on the end of Mata's chipped pass but Guzan smothered his attempt from close range.
On the half-hour Lampard came desperately close to his landmark goal, seeing a low free-kick squirm out of Guzan's hands and roll gently against a post.
Chelsea were starting to find their feet in the game when a series of refereeing decisions took centre stage.
The first two appeared to err on the lenient, Benteke booked rather than sent off for an elbow on Cesar Azpilicueta and Terry also shown yellow despite seeming to be the last man when he felled Sylla.
Lee Mason did flourish red just before the interval though, the struggling Ramires earning a second booking for high feet on Gabriel Agbonlahor.
Rafael Benitez reshuffled at half-time, sending on David Luiz to anchor the midfield and taking off the ineffective Victor Moses.
Villa's extra man lasted only until the 58th minute, Benteke the man to go this time, again for a second yellow and again for high feet.
Within two minutes the scores were level and Lampard was celebrating his long-awaited record-equalling goal. Eden Hazard rolled him the ball from the right flank, he shepherded it into a more central position and then fired home a curling left-footed effort.
He was duly mobbed by team-mates as he ran to the away support to take in the moment.
The frenetic pace continued, with Chelsea believing they had gone ahead after 71 minutes.
Former Villa man Cahill took the ball on the chest before prodding goalwards at the back post.
Guzan was beaten but Sylla managed to trap it on the line. Ba and Ashley Westwood both moved in, with the latter convincing officials his clearance came before the ball had crossed.
Chelsea's substitutes, warming up on the touchline, seemed to disagree but their appeals went unheard.
Terry departed on a stretcher after suffering an injury which will place his own Europa League final hopes in severe doubt, but Lampard was yet to have his final say on proceedings.
The winner came from a fine Chelsea move, Hazard taking in a one-two in left channel before cutting the ball across goal for Lampard.
As so often in his Chelsea career, he was in the right place at the right time and he tapped home with ease.
The celebrations which followed were both intense and lengthy, with all Chelsea's players involved.
Seven minutes' injury time were eventually issued but Villa could not find an equaliser despite their efforts.