A late Don Hutchison goal salvaged a point for West Ham in Trevor Brooking's last match in charge before new manager Alan Pardew is installed next week.
But it was a game the home side should have won at a canter given the number of chances they had - and Burnley were grateful to goalkeeper Brian Jensen, who produced a string of fine saves.
The Dane let in six goals at Ipswich on Tuesday but made up for that with a superb display this time as he constantly thwarted strike duo Jermain Defoe and David Connolly.
Burnley goals came from Delroy Facey and Ian Moore.
Jensen had already denied Defoe when Connolly put the Hammers ahead in the 20th minute, producing a cool finish to round the goalkeeper and stroke the ball home.
The visitors had their first chance when Robbie Blake forced England goalkeeper David James into a save.
But Jensen continued to be the busier keeper, keeping out Connolly when the Republic of Ireland international was one-on-one.
It was a surprise therefore when Burnley equalised in the 38th minute, Facey tapping home after good work from Luke Chadwick had allowed Moore to lift the ball over James.
In the second half, Connolly hit the woodwork and Matt Etherington and Defoe had shots saved by Jensen before Moore stunned the home fans by giving Burnley the lead eight minutes from time.
Moore drilled the ball into the net from close range soon after Grant had struck the goal frame with an effort from the edge of the area.
Just when West Ham were wondering how they had lost, Hutchison rifled a spectacular left-foot volley high into the net to preserve his side's unbeaten home record.
West Ham: James, Repka, Dailly, Pearce, Quinn, Alexandersson, Carrick, Lee, Etherington, Defoe, Connolly. Subs: Bywater, Hutchison, Mellor, Ferdinand, Kilgallon.
Burnley: Jensen, West, Camara, Gnohere, Branch, Weller, Chaplow, Chadwick, Facey, Ian Moore, Blake. Subs: Roche, Grant, Farrelly, O'Neill, Pilkington.
Referee: I Williamson (Berkshire)