Veteran Ronaldinho, who donned the famous yellow shirt for the first time in a year, missed a first-half penalty for the five-times world champions and England capitalised when Rooney gave the hosts a 27th-minute lead.
Substitute Fred equalised for Brazil just three minutes after coming on and struck the crossbar as Scolari's side came alive in a fixture arranged to kick off the 150th anniversary year of the Football Association.
Lampard, one of six Chelsea players on display including Ashley Cole making his 100th appearance for England, sent the majority of the 87,000 fans home happy with a superb curled winner on the hour.
England hung on with few alarms for their first victory over Brazil in nine attempts stretching back to 1990.
The match began at sedate pace with with only an early burst from Neymar briefly raisiing the decibel level, although his touch let him down badly.
Brazil keeper Julio Cesar did well to claw away a Rooney header although the wshistle had already been blown.
Scolari's side had the better of the opening 20 minutes and Ronaldinho earned a penalty when his cross was handled by Jack Wilshere.
With boos ringing round, however, the architect of much pain for England and English clubs down the years, had his spot-kick saved low down by Joe Hart who reacted superbly to deny Ronaldinho on the follow-up.
The let-off energised England and they went ahead when Wilshere, proving more useful at the other end, slid in Theo Walcott whose shot was saved by Cesar, only for Rooney to cooly steer a shot through a crowd of players.
Neymar was struggling to live up to his pre-match hype and the Santos player somehow contrived to scoop the ball over the bar from Oscar's teasing cross.
A raft of halftime substitutions, including Ronaldinho's removal from the action after a disappointing 45 minutes and the introduction of former Everton player Fred, revived the visitors.
England defender Gary Cahill carelessly conceded possession after 48 minutes and was left with his head in his hands after Fred lashed Brazil's equaliser past Hart in front of a sizeable Brazilian contingent behind the goal.
Rattled, England almost went behind immediately when Fred curled a fierce shot on to the crossbar, but Roy Hodgson's side quickly regained their poise and went back in front on the hour.
Rooney snatched possession from Arouca's weak pass and he teed up Lampard who curled a precise shot from outside the area past the despairing dive of Cesar and in off the post.
Brazil thraetened sporadically after that but Scolari, who led them to victory at the 2002 World Cup, was left with much to ponder as he prepares to lead the hosts at next year's finals
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)