Just three points separated the two sides before kick-off and both came into the game struggling for form, with the hosts having won just once in their last five and the Hammers with one victory in their last six.
Both teams are still in with a shout of sneaking into a European place however, and it was the UEFA Europa League quarter-finalists West Ham who first came close to opening the scoring on the quarter-hour mark.
Jarrod Bowen nicked the ball off Nélson Semedo and picked out Tomáš Souček but the Czech international failed to get the ball out of his feet despite only having to tap in.
Following the early chance for the visitors, Wolves began to grow into the game, taking full control as the half went on.
The dominance almost produced a goal as Rayan Aït-Nouri, arguably their player of the season, almost fashioned a chance to break the deadlock after going on an amazing 50-yard run up the pitch but Kurt Zouma made a tackle just before the Moroccan was about to shoot.
Aït-Nouri continued to prove dangerous and this time his run into the box produced a penalty after he was felled by Emerson Palmieri. Pablo Sarabia stepped up and smashed the spot kick in off the post to give Wolves the lead.
David Moyes was clearly unhappy with his side’s first-half performance as he turned to his bench, making a double switch, introducing Benjamin Johnson and Michail Antonio.
The Hammers boss was forced to make another change within 10 minutes of the restart and this time it was a big blow as top scorer Jarrod Bowen was taken off injured. Following the changes, there was a change in momentum for the away side.
A penalty was awarded after Max Kilman handled in the box and Lucas Paquetá stepped up to draw his side level.
It looked like both sides were going to continue their winless run but the Hammers struck late on in bizarre circumstances.
James Ward-Prowse’s swinging corner went all the way in, beating José Sá - perhaps with the wind assisting the West Ham midfielder.
Kilman thought that he redeemed himself late into stoppage time as he popped up at the death to head home and give Wolves a point but it was cruelly ruled out following a VAR review, giving the Hammers a first win in five league games, and condemned O'Neill's men a third defeat in five league games.
Flashscore Man of the Match: James Ward-Prowse (West Ham United)