Defeat for Burnley against Liverpool on Sunday would all but confirm that West Ham are safe and ensure that Wigan will be in the top flight next season.
It was a tense afternoon for all concerned at Upton Park, with Gianfranco Zola's side looking to bounce back from Monday's capitulation against Liverpool at Anfield and the Latics looking for the three points that they knew would keep them up.
The nerves of the home fans were not helped by Wigan's opening goal after just four minutes, with Watson's corner coming off Spector's head and bouncing past the helpless Green.
Zola praises 'outstanding' West Ham
Replays showed the ball was outside the corner quadrant when Watson delivered his cross but the goal was allowed to stand.
Cole should have levelled soon afterwards when he ran clear and rounded Kirkland but he did not look up before firing goalwards, and failed to see that Gary Caldwell had got back to brilliantly block the ball on the line.
That was the only clear-cut chance created by the Hammers in the first half-hour, though, and their fans were not slow to show their displeasure, greeting every misplaced pass with loud groans and jeers.
Wigan, in contrast, were looking composed on the ball and came close to scoring a second goal when James McCarthy's fierce strike from the edge of the area was superbly tipped on to the bar by Green.
Instead of being 2-0 down, West Ham were quickly level; with a swift counter-attack seconds later ending with Cole's cross being slid home by Ilan.
Martinez frustrated by defeat
The turnaround was completed on the stroke of half-time when Noble's curling free-kick was parried by Kirkland, only for Kovac to run in and nod the rebound into the empty net.
Wigan were not done yet, however, and Rodallega made it 2-2 from close range on 52 minutes after Victor Moses flicked on Watson's corner.
West Ham's players protested that the Colombian had bundled the ball home with his hand at the far post but, after consulting his linesman, referee Alan Wiley allowed the goal to stand.
Suddenly it was the Latics who were back on top and it took a good save from Green to keep out Charles N'Zogbia's free-kick.
At the other end, the Hammers threatened when Kovac's looping header bounced off the top of the bar from Noble's corner.
The game looked set for a frantic finale until, with 13 minutes left, Parker latched on to a knockdown by substitute Guillermo Franco and let fly with a low shot that fizzed past Kirkland and into the bottom corner of the net.
Wigan pressed forward but the closest they came to another equaliser was when Titus Bramble's hopeful long-range lob sailed over the top of Green's crossbar.
West Ham boss Gianfranco Zola on Scott Parker's winner: "It was a great goal and great result.
"It was a great finish and not an easy shot because he did not have an angle, but he hit it perfectly.
"I cannot celebrate yet. We want to stay focused and want to finish this championship with some more points."
Wigan boss Roberto Martinez: "We deserved something from the game, but both teams clearly wanted to win which made it very open.
"We imposed ourselves in spells and it is very frustrating that we could not reflect that by picking up any points.
"From our point of view I felt we could have done better with the three goals we conceded."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.