Gabriel Agbonlahor propelled Aston Villa towards Barclays Premier League safety and edged West Ham towards relegation with an injury-time winner at Upton Park.
The Hammers had taken the lead inside two minutes with a strike from Robbie Keane but Villa wrestled back control with Darren Bent's header shortly before the interval.
West Ham goalkeeper Robert Green pulled off a string of top-class saves to keep his side in the game but Villa snatched a deserved victory with a header from substitute Agbonlahor in added time.
Villa's victory moved them up to ninth in the table on 40 points, seven clear of the drop zone, while Avram Grant's struggling side slipped deeper into trouble.
The Hammers have five games left to save their season. The next two are away at Chelsea and Manchester City.
West Ham had billed the game as a celebration of the "Best of British" in anticipation of St George's Day and the Royal Wedding and there were 14 players from these shores in the two starting line-ups.
Scott Parker was missing for West Ham with a troublesome Achilles and replaced in midfield by Gary O'Neil while Carlton Cole, Victor Obinna and Lars Jacobsen all came into the team beaten 3-0 by Bolton last weekend.
Aston Villa featured two changes from their victory over Newcastle, with Emile Heskey and former Hammers captain Nigel Reo-Coker replacing Agbonlahor and Jean Makoun.
West Ham had promised a "traditional street party atmosphere" and the Upton Park faithful were waving their claret and blue pennants inside two minutes after Keane opened the scoring.
O'Neil's blocked shot from a West Ham corner fell to Thomas Hitzlsperger, who lofted a header towards Keane on the edge of the six yard box.
Keane was played on-side by Ashley Young, who had been marking the far post, and the on-loan Tottenham striker turned to rifle his shot past Brad Friedel.
