West Ham goalkeeper Robert Green shows his disappointment after his team's 3-2 loss at Wigan Athletic and subsequent relegation from the Premier League (AP Photo)
Avram Grant's side needed a victory if they were to stand any mathematical chance of avoiding the drop and looked to be on their way to attaining it thanks to two Demba Ba headers in the first half.
But two goals from Charles N'Zogbia—the second an injury-time winner—and a Conor Sammon effort condemned the London side to the Championship.
Victory meant Wigan could yet stay up if they get a draw or better at Stoke City on the final day of the season next weekend.
A fraught opening saw Wigan dominate the early stages but that all changed after 12 minutes when Ba brilliantly headed in from Thomas Hitzlsperger's whipped-in cross.
Wigan's biggest fault this season has been their inability to really penetrate and threaten opposition teams when it matters most and that problem was in evidence again in the first half.
And it did not take visitors West Ham long to punish them even further as they doubled their advantage after 26 minutes, prompting some Wigan fans to leave before half-time was even in sight.
After a period of sustained Wigan pressure, West Ham raced to the other end and again made the most of Wigan's sloppy defending as Hitzlsperger?s cross was flicked on by James Tomkins at the near post, with Senegal striker Ba in the right place to bundle in with his head.
Wigan were booed off at half-time and that prompted manager Roberto Martinez into bringing Sammon and Victor Moses off the bench for the second half in a bid to rescue thee Latics' season—and that is exactly what Wigan did.
They were given the first glimmer of hope just before the hour when N?Zogbia curled home a marvellous free-kick from 20-yards, and that gave Wigan the encouragement to keep attacking with wonderfully exciting consequences.
Shortly after Ba had missed a chance to grab a hat-trick after miskicking when clear through on goal, Hugo Rodallega found Sammon in the area and he turned his defender and swept past England goalkeeper Robert Green to set the encounter alight.
That goal meant West Ham's fate was sealed and their mood was not helped by an airplane that then flew over the DW Stadium trailing a banner with the phrase, "Avram Grant: Millwall Legend", in a prank apparently set up by supporters of West Ham's arch London rivals.
It got ever more frantic as both teams looked for the winner, with Wigan still the stronger and more attack-minded outfit as the game opened up.
Wigan had several chances to win it but Emmerson Boyce could not convert from close range following a corner, Ben Watson hit the post and Sammon also failed to beat Green in injury time.
However, with the last kick of the game, N'Zgobia turned inside the box and drilled a low effort that snuck under Green and ensured Wigan's survival campaign was extended to the final day of the season.
Meanwhile, Israeli boss Grant oversaw his second successive relegation from the Premier League following Portsmouth's demotion last season.