Rooney opened the scoring after Ronaldinho had seen an earlier penalty saved by Joe Hart, with Fred equalising for A Seleção after the interval.
Lampard grabbed his 27th international goal on the hour-mark to see England to their first victory over the five-time FIFA World Cup™ champions for over two decades.
There was early pressure from Brazil, as Neymar played a quick one-two with Oscar to set the Santos man free down the right wing past Ashley Cole, who was celebrating a century of international appearances. As Neymar entered the penalty area, Gary Cahill slid in to clear.
A Gerrard corner then found Rooney free in the middle of the box. The Manchester United man saw his header magnificently tipped over by Julio Cesar, but the England forward was adjudged to have fouled his marker in the build-up to the chance.
Adriano intercepted a loose ball and Neymar broke down the left-hand side into space vacated by Glen Johnson. Neymar fed Oscar whose shot flew over the bar.
The referee was then called into action in the 18th minute as Oscar picked a loose ball up on the England left. His cross towards goal was blocked by Jack Wilshere, with the referee deeming that it had hit the Arsenal midfielder’s arm.
Ronaldinho stepped up and drove his penalty low to Joe Hart’s left-hand side. The Manchester City keeper did well to keep the first effort out, and showed great reactions to deny Ronaldinho’s follow-up. Neymar scooped the ball wide in the ensuing scramble.
England responded immediately with Johnson bounding down the right-hand side. The ball found its way to Jack Wilshere who slipped a delightful through-ball towards Danny Welbeck but the Manchester United forward could only blaze his effort over the bar.
England broke the deadlock before the half-hour mark after more positive play by Wilshere. The Arsenal midfielder played club team-mate Theo Walcott in behind Brazil left-back Adriano and the wideman sent him clear. His shot was saved well by Julio Cesar but the Queens Park Rangers goalkeeper could do nothing to stop Rooney following up to slide home.
Immediately after the goal, Walcott was played in once again by Wilshere, with the frontman dancing past a couple of challenges before sliding towards Rooney. The ball was hastily cleared by Dante with Roy Hodgson’s men looking dangerous on the counter-attack.
Oscar then found space on the Brazil right, his vicious ball flashed across the box invitingly for Neymar, but the Santos forward’s momentum saw the ball fly harmlessly over the bar.
Just before half-time, Wilshere drove at the Brazilian defence once again, but was halted by David Luiz. The ball broke to Rooney whose drive fizzed just wide of Julio Cesar’s right hand post.
England went into the break a goal to the good and Hodgson, who would have been pleased with his side’s first-half performance, introduced Leighton Baines and Lampard.
It would be Luiz Felipe Scolari’s half-time changes that would make the most immediate contribution, with England partly to blame for the Brazilian equaliser.
Cahill tried to play out from the back but lost the ball to Chelsea team-mate Oscar inside his own half. The ball broke to the recently-introduced Fred who slammed a shot past the diving Hart.
England seemed stunned and another chance fell to Fred. The Fluminese frontman hit the bar after Hart was forced into an uncomfortable sliding clearance.
Roy Hodgson’s men rallied and created more chances of their own, with Cahill seeing a header tipped over from a corner and Gerrard hitting a shot from the edge of the box over the bar.
It was to be another one of the half-time substitutes who would make a goalscoring impact on the hour-mark.
After a mix-up in the Brazilian defence the ball fell to Rooney who dropped the ball off to the waiting Lampard. The Chelsea midfielder’s curled half-volley cannoned in off Julio Cesar’s left-hand post for his 27th goal on his 94th international appearance.
The rest of the half saw few chances for either side, although substitute Baines flashed a dangerous-looking ball across the Brazilian box, with none of his team-mates able to connect.
The South Americans will have the opportunity to exact their revenge in June, when Scolari's side host England at the Maracana, just a few weeks before the country hosts the FIFA Confederations Cup.