Joe Willock came off the bench to dent 10-man West Ham's Champions League charge as Newcastle took a giant stride towards Premier League safety.
The Arsenal loanee, who scored a late equaliser against Tottenham on April 4, went one better to condemn the Hammers – who would have gone third with victory – to a 3-2 defeat at St James' Park, in the process sending Steve Bruce's men nine points clear of the relegation zone with just six games to play.
On an eventful afternoon on Tyneside, the visitors trailed 2-0 at the break courtesy of Issa Diop's own goal and a howler from keeper Lukasz Fabianski which handed Joelinton a second, and had also seen defender Craig Dawson sent off for a second bookable offence.
Remarkably, they dragged themselves back into it through Diop's header and Jesse Lingard's 80th-minute penalty – his ninth goal in 10 games – before Willock dashed their hopes in a grandstand finish.
After a positive start by the home side, Dawson headed a Mark Noble free-kick straight at keeper Martin Dubravka as the Londoners started to make an impression.
Diop made a vital block to deny Allan Saint-Maximin after he had carved a swathe through the visitors' defence, but as he half wore on, it was David Moyes' men who began to exert a measure of control with Noble increasingly prominent.
However, their hopes were torn apart inside five catastrophic minutes as they handed they hosts a commanding lead.
First Dawson, in his attempts to recover from a heavy touch, felled Joelinton on halfway and could only look on as Saint-Maximin sped away, twisted his way past the retreating Noble and then saw his weak shot bundled over the line by Diop as referee Kevin Friend allowed play to continue.
Dawson's misery was compounded when, having already been booked for a 12th-minute foul on the Brazilian, he received a second yellow card, but even worse was to follow.
Joelinton, who had previously scored only two Premier League goals this season, was handed a third by Fabianski when he spilled Matt Ritchie's 41st-minute corner to leave the striker with a tap-in from a yard.
West Ham returned in bullish mood and adopted a high line and attempted to press despite their numerical disadvantage, and Paul Dummett had to block Angelo Ogbonna's goal-bound header on the hour.
Bruce sent on leading scorer Callum Wilson as a 64th-minute replacement for the tiring Saint-Maximin in a bid to arrest to visitors' resurgence, but Dubravka was relieved to field wing-back Vladimir Coufal's header seconds later after he had been allowed to ghost in at the far post.
However, Diop headed the Hammers back into it with 17 minutes remaining, and they were level within seven minutes when, after a VAR check, Ciaran Clark was penalised for handball and Lingard struck from the spot.
But there was to be fresh drama when, after Jacob Murphy had seen his effort cleared off the line, Willock, who had only been on the pitch for seconds, thumped a header past Fabianski from Ritchie's cross to win it.
No Data Analysis info