In a lively opening, Ronaldinho missed a penalty and the rebound after a superb double save from Joe Hart.
The industrious Jack Wilshere played in Theo Walcott, with his shot rebounding to Wayne Rooney for a measured finish.
Brazil levelled when Fred took advantage of Gary Cahill's error, but Lampard curled in from the edge of the box after an hour to earn victory.
It was an enterprising and encouraging performance by Roy Hodgson's England, with Wilshere at the heart of much of their endeavour.
And although Fred also hit the the bar in a wobbly spell after the break, the hosts carved out more opportunities and were in control for long spells of the game.
Neymar missed a glaring chance in the first half, but defeat for 2014 World Cup hosts Brazil was their first following seven consecutive victories
England
- 01 Hart
- 02 Johnson
- 03 Cole (Baines - 46' )
- 05 Cahill
- 06 Smalling
- 04 Gerrard
- 07 Walcott (Lennon - 75' )
- 08 Wilshere
- 11 Cleverley (Lampard - 46' )
- 09 Welbeck (Milner - 61' )
- 10 Rooney
Substitutes
- 13 Butland
- 12 Walker
- 14 Baines
- 15 Jagielka
- 16 Lescott
- 17 Milner
- 18 Lampard
- 19 Osman
- 20 Lennon
- 21 Oxlade-Chamberlain
Brazil
- 01 Julio Cesar
- 02 Alves
- 03 David Luiz (Miranda - 78' )
- 04 Dante
- 06 Adriano Correia (Filipe - 69' )
- 05 Ramires (Arouca - 46' )
- 07 Oscar
- 08 Paulinho (Jean - 62' )
- 10 Ronaldinho (da Silva Lucas - 46' )
- 09 Luis Fabiano (Fred - 46' )
- 11 Neymar
Substitutes
- 22 Diego Alves
- 13 Filipe
- 14 Da Silva Leandro Castan
- 15 Miranda
- 16 Arouca
- 17 Jean
- 18 da Silva Lucas
- 19 Fred
- 20 Hulk
Att: 87,453.