Jarrod Bowen scored an injury-time penalty to condemn Manchester United to a 2-1 defeat in the Premier League, easing pressure on West Ham manager Julen Lopetegui but piling it high once again on Erik ten Hag.
Casemiro thought he had grabbed a point for the visitors when he headed home with less than 10 minutes left to cancel out Crysencio Summerville's 74th-minute opener.
But United were furious as referee David Coote was sent to the pitchside monitor by the video assistant referee to review Matthijs de Ligt's challenge on Danny Ings in the box.
Despite protests from United's players over a handball by Ings, Coote pointed to the spot and Bowen calmly converted, slotting past Andre Onana.
The Premier League later explained on its Match Centre account on X that there was "sufficient contact" to award the penalty.
"The referee did not award a penalty to West Ham for a challenge by de Ligt on Ings," it said., external
"The VAR deemed there was sufficient contact on Ings' lower leg and recommended an on-field review. The referee overturned his original decision and awarded a penalty."
United dominated possession and chances in the first half at London Stadium, but the visitors lacked a clinical edge and were left to rue their missed chances.
After a lacklustre first half, West Ham were an improved side after the interval and peppered United's box with attacks, and they were eventually rewarded when Summerville slid in to direct Ings' scuffed effort into the back of the net.
The result leaves United 14th in the Premier League with just three wins in their opening nine matches.
It is a statement win for West Ham, however, as they move one place above United after an underwhelming start to the season.
Wasteful Man Utd rue first-half chances
It was a poor day at the office in front of goal for Ten Hag's side, who should have been out of reach when the referee blew the half-time whistle.
Alejandro Garnacho was a constant threat on the left wing, making it a tough afternoon for former team-mate Aaron Wan-Bissaka, and he nearly opened the scoring in the second minute as he rattled the hosts' crossbar.
The Argentine drilled a shot wide shortly after, while Diogo Dalot missed an open goal after cleverly flicking the ball past Lukasz Fabianski.
Rasmus Hojlund and Marcus Rashford both had efforts smothered by Fabianski, while Bruno Fernandes lofted a header over the bar as the visitors continued to dominate the opening 45 minutes.
The crossbar worked in West Ham's favour again when it stopped a defensive header from Edson Alvarez from going in and a brilliant one-handed save by Fabianski ensured Casemiro didn't head home just before the break.
With the club winning just once in their last eight games, there will undoubtedly be more questions over Ten Hag's future at the club.
Substitutes save Lopetegui
Clearly unhappy with his team's lacklustre first-half performance, where they failed to register a single shot on target, Lopetegui made a triple substitution.
Carlos Soler, Lucas Paqueta and Konstantinos Mavropanos all hauled off in favour of Summerville, Tomas Soucek and Jean-Clair Todibo, while Ings was brought on with 20 minutes remaining.
Summerville, a £25m summer signing who scored 20 goals for Leeds United in the Championship last season, will be glad to be get off the mark in east London.
The Dutchman caused problems on the right wing, while Ings looked dangerous as his team-mates lofted balls into the box.
Having registered only a single shot in the opening half, the Irons started to prioritise attack as their main form of defence and hit 11 efforts while limiting their opponent's chances.
After a humbling 4-1 defeat by Tottenham last weekend, this result could mark a turnaround in Lopetegui and West Ham's fortunes.
Player of the match
After the opportunity to rate players has closed, the score displayed represents the average from all the submissions by BBC Sport users.