JOE Willock’s late introduction, and sensational 82nd minute-headed winner, saw Newcastle clinch the victory that effectively guaranteed their Premier League survival against West Ham’s 10 men.
But Steve Bruce’s side made hard work of the victory, having squandered a two-goal lead against a Hammers side themselves desperate for the points for a top-four finish.
It looked as though in-form Jesse Lingard had snatched a point when he calmly converted an 80th-minute penalty, awarded by VAR after Ciaran Clark handled in the area.
West Ham had looked well-beaten at half-time, having had defender Craig Dawson sent off while conceding the opening goal, but Issa Diop gave the visitors hope when he headed in Jarrod Bowen’s cross from 12 yards after 73 minutes.
But Newcastle manager Steve Bruce reacted to Lingard’s equaliser by throwing on Arsenal loanee Willock and within a minute he rose to meet Matt Ritchie’s cross with a perfect and powerful finish.
The game had burst into life in an explosive 36th-minute incident which started with Dawson losing the ball on halfway and fouling Joelinton as the Newcastle man took possession.
With advantage played, the lively Allan Saint-Maximin continued into the area and produced a shot that should have been easily dealt with by defender Issa Diop or keeper Lukasz Fabianski.
Instead, the pair collided with each other and could only watch as the ball ricocheted off Diop and into the West Ham goal.
Nor was the agony over for Moyes, with referee Kevin Friend correctly handing Dawson a second yellow, to go with an earlier one for a lazy foul on Joelinton, which reduced the Hammers to ten men.
It left the visitors with a mountain to climb as they looked to strengthen their hold on fourth palace and it took just five minutes for the situation to worsen.
A routine corner should have been easily caught by Fabianski four minutes before the interval but the keeper succeeded only in dropping the ball inside the six-yard area, delivering it to the alert Joelinton who tapped in from point-blank range.
Dubravka 6; Murphy 7, Fernandez 6, Clark 6, Dummett 6, Ritchie 7; Almiron 7, Shelvey 6, S Longstaff 7 (Willock 82); Joelinton 7 (Carroll 90), Saint-Maximin 8 (Wilson 64, 6).
Gayle, Lewis, Hendrick, Krafth, Manquillo, Willock, Gillespie.
Fabianski 4; Diop 5, Dawson 4, Ogbonna 6; Coufal 7, Noble 7 (Benrahma 75, 6), Soucek 6, Johnson 6 (Fredericks 90); Fornals 5; Bowen 6, Lingard 6 (Lanzini 87).
: Balbuena, Yarmolenko, Alves, Martin, Trott, Coventry.
K Friend 7.