The England midfielder, restored to the starting XI ahead of Wednesday's Europa League final, cancelled out Christian Benteke's opener just after the hour mark before sealing the points with a 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.
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. Benteke 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.
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.
Ramires earned a second booking for high feet on Gabriel Agbonlahor. But 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. Eden Hazard rolled Lampard the ball from the right flank, he shepherded it into a more central position and then fired home a curling left-footed effort.
Chelsea believed they had gone ahead when 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.
John 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.
Hazard took in a one-two on the left 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.