Casemiro cancelled out an opener from Crysencio Summerville to leave the two teams level heading into the final exchanges, but a Jarrod Bowen penalty handed the Hammers all three points on home soil.
Here, Sports Mole takes a close look at how each player performed in the English capital.
West Ham player ratings vs. Man United: Crysensio Summerville demonstrates class in last-gasp win
GOALKEEPER
Lukasz Fabianski- 7/10
Did everything asked of him throughout the match, with the experienced goalkeeper coming up with some excellent saves, while he was able to take the pressure off his defence in the latter stages with some important claims.
DEFENCE
Aaron Wan-Bissaka - 6/10
Limited on the ball, which has been the case throughout his career, and he found it difficult in the opening half of action, but like a number of his teammates, Wan-Bissaka grew in the second period.
Max Kilman - 6/10
West Ham rode their luck in the first half, with Man United having so many chances to score, but Kilman was strong in the second half and was able to help his side resist the later pressure.
Konstantinos Mavropanos - 6/10
Was booked in the first period, with the centre-back struggling against the pace of Alejandro Garnacho and Rasmus Hojlund, and it was not too much of a surprise when he was replaced at the interval.
Emerson - 6/10
Did not offer much of an attacking threat, and Man United did have some good moments down their left, but he deserves praise for a solid second-half performance from the capital outfit.
MIDFIELD
Guido Rodriguez - 6/10
Hardly had a kick in the opening half of action, with Man United dominating in the midfield area, but he seemed to have more of an influence when Tomas Soucek was introduced at the break.
Lucas Paqueta - 5/10
Was booked in the 25th minute for stopping a quick free kick, and the Brazil international was simply not able to get into the match. Replaced at the interval as part of a triple change for the Hammers.
Edson Alvarez - 6/10
Probably the pick of the West Ham midfielders in the first period, with the Mexican neat and tidy in possession of the ball, and he grew as the contest progressed, with the Hammers ultimately securing all three points.
ATTACK
Jarrod Bowen - 7/10
Was not involved in the first half, with Man United dominating the contest, but he was a real threat for West Ham in the second period and showed excellent composure to find the back of the net with a pressure penalty.
Michail Antonio - 6/10
Found it very difficult in the opening half of action, with the forward hardly in the match, but he did improve in the second period and was able to offer a threat before being replaced by Danny Ings.
Carlos Soler - 5/10
Given the nod in an attacking area due to the absence of Mohammed Kudus through suspension, but the Spaniard was just not involved, and he was replaced at the half-time break by Summerville.
SUBSTITUTES
Jean-Clair Todibo - 6/10
Has had a difficult start to his West Ham career, and there will have been a lot of eyes on him in the second period, but the Frenchman out in a much-improved performance at the London Stadium.
Tomas Soucek - 6/10
Was somewhat of a surprise that he did not start, with West Ham lacking a physical presence without him, and it was not a shock that their performance level improved when he was introduced.
Crysencio Summerville - 8/10
Simply changed the match for West Ham in the second period, with the attacker proving to be too fast and too clever for the Man United defenders. Scored the game's opening goal and could have had another in the latter stages.
Danny Ings - 7/10
Made a telling contribution at the London Stadium, with Ings involved in the opening goal of the match, while he was fouled by Matthijs de Ligt in the penalty incident, so it was a very productive outing for the experienced forward.
Man United player ratings vs. West Ham: Alejandro Garnacho made to pay for missed chances
GOALKEEPER
Andre Onana - 6/10
Made a smart save in the latter stages to keep out a striker from Summerville, and he could not do anything about either West Ham goal; Onana has been one of Man United's better performers this season and that was again the case here.
DEFENCE
Diogo Dalot - 4/10
Had a golden chance to score in the first half, but he somehow fired over the crossbar in a miss-of-the-season contender. Found it difficult defensively in the second period, with West Ham having joy down Man United's right.
Matthijs de Ligt - 6/10
Gave away the penalty that ultimately led to West Ham scoring a second, but it was a harsh award, and the Netherlands international was solid for long stages of the fixture in the English capital.
Lisandro Martinez - 6/10
Made some vital challenges in the second period, but he was ultimately a part of a defence that conceded twice, with Martinez finding it difficult to show his best form for the 20-time English champions at this moment in time.
Noussair Mazraoui - 6/10
Was unable to complete the match, having picked up an injury in the latter stages, but the Moroccan defended well for long spells of the contest and can be pleased with his overall contribution at the London Stadium.
MIDFIELD
Christian Eriksen - 6/10
Has been in good form this season, so it was not a surprise when he started in central midfield, and the Denmark international was impressive in the first period, but he struggled in the second and was replaced by Joshua Zirkzee.
Casemiro - 7/10
Scored in the latter stages with a clever header, and Casemiro was certainly one of Man United's best performers on the afternoon, which is encouraging moving forward for the rest of the campaign.
Bruno Fernandes - 5/10
There is no getting away from the fact that Fernandes is finding it difficult to reach his best form this season, and the Portugal international again struggled against West Ham, especially in the second half.
ATTACK
Alejandro Garnacho - 6/10
Should have scored twice in the early stages, smashing one against the crossbar and placing one wide, and Man United were made to pay for those missed opportunities, but he was a constant threat.
Rasmus Hojlund - 5/10
The forward is still working his way back from a muscular injury, and he found it difficult on Sunday afternoon. Hojlund is bidding to build on a positive first season at Man United, and he simply needs a run of games at this stage of the campaign.
Marcus Rashford - 5/10
Had his moments in the first period, but passed up his only chance, and the forward struggled at the start of the second period. Rashford was the first Man United player substituted, with Amad Diallo brought onto the field.
SUBSTITUTES
Amad Diallo - 6/10
Would have been disappointed not to start, and Amad had a positive impact during his 30 minutes on the field.
Joshua Zirkzee - 6/10
Has had a difficult start to his Man United career, but the Netherlands international was involved in Man United's leveller, heading down for Casemiro to register, and he was a threat in the box in the latter stages.
Victor Lindelof- 6/10
Was introduced in the latter stages of the contest after Mazraoui went off injured.