Leicester 1 West Ham 2
And Jack Collison scored the Hammers' winner, firing home from 25 yards.
West Ham are two points behind the Saints going into the final day.
The Hammers need to beat Hull City on the final day and hope that Southampton lose to relegated Coventry. If the Saints draw, West Ham would need to win by three or four - depending on how many goals the Saints score - to clinch promotion.
West Ham started the brighter and Ricardo Vaz Te almost got onto the end of Mark Noble's through ball but it ran just too far and into Kasper Schmeichel's hands in the Leicester goal.
The Foxes goalkeeper then saved well down low from Collison's shot after Sol Bamba was caught dawdling by Carlton Cole.
Noble's free-kick was headed wide by Cole, who was then only denied by a last-ditch Wes Morgan challenge after chasing onto Noble's 60-yard ball.
Final day permutationsIf Southampton draw on the final day and West Ham win but score four more goals than the Saints, their records would be identical. Their head-to-head record would then be taken into account, which Southampton would win after a 1-0 win and 1-1 draw
Leicester's lead was shortlived though. Noble rolled the ball to Taylor, whose wonderful low cross was converted from close range by Reid.
And with the momentum all West Ham's, Vaz Te had a powerful effort deflected wide by Morgan, Tomkins headed past the post and Vaz Te flashed a free-kick wide.
After the break, West Ham continued to chase the goal they needed to keep their automatic promotion dreams alive.
Soon after the restart, Noble hit a brilliant shot from the edge of box that went just wide and then fired well over after Gary O'Neil found him unmarked from a similar distance.
And their persistence paid off when O'Neil's shot was cleared by the Leicester defence but only as far as Collison, who smashed the ball home. Schmeichel got a hand to the effort but could not keep it out.
Moments later Collison could have killed the game off but his shot was deflected over by Bamba.
The Hammers continued to push for a third goal to seal the game and boost their goal difference and Tomkins headed wide, while Vaz Te and Collison failed to capitalise on a great chance to shoot in the box.
Leicester's Marshall had an effort from 25 yards out that was easily handed by Green. And minutes later, perhaps sensing that the game was not yet won, Sam Allardyce brought on defender Danny Collins for striker Cole and the Hammers saw the game out.
After Nolan missed a chance to add a late third, they almost paid the ultimate price with Green having to save Morgan's last-gasp header.
- 01 Schmeichel
- 02 Peltier
- 03 Konchesky
- 06 Bamba
- 26 Morgan
- 10 King (St Ledger - 46' )
- 16 Drinkwater
- 19 Wellens (Dyer - 22' )
- 20 Beckford
- 22 Marshall
- 35 Nugent (Waghorn - 65' )
- 12 St Ledger
- 11 Dyer
- 09 Howard
- 13 Vassell
- 14 Waghorn
West Ham United
- 01 Green
- 02 Reid
- 05 Tomkins
- 20 Demel (Faubert - 76' )
- 04 Nolan
- 10 Collison (Lansbury - 88' )
- 14 Taylor
- 16 Noble
- 32 O'Neil Booked
- 09 Cole (Collins - 81' )
- 12 Vaz Te
- 18 Faubert
- 25 Collins
- 21 Diop
- 22 Lansbury
- 07 Baldock