Marko Arnautovic’s early opener for the hosts was cancelled out by Henri Saivet’s free kick – his first goal for the club.
Former Hammer Mohamed Diamé put Rafa Benítez’s side back in front after the break, before goalkeeper Rob Elliot produced an excellent penalty save from Andre Ayew.
Christian Atsu then rounded off a flowing move from the Magpies to make it 3-1 on the hour, and despite Ayew’s close-range consolation, the visitors held on to claim a much-needed victory.
United had made a disastrous start on their first ever visit to the London Stadium. Saivet, on his first league start of the season, misplaced his pass, giving Arnautovic the chance to run at Ciaran Clark with just five minutes on the clock. The Austrian drove towards the box before finding space to pull the trigger with his right root, and his shot beat Elliot and found the bottom left-hand corner.
But it took Senegalese midfielder Saivet barely five more minutes to make amends in style. When Joselu was fouled around 25 yards from goal, the visitors were initially aggrieved that an advantage hadn’t been played. But seconds later, Saivet stepped up to strike the resulting free kick, whipping his shot over the wall and past Adrian’s dive. It nestled in the corner, levelling the scores and sparking celebrations from the 3,000 travelling fans.
And Newcastle almost had a second soon after, when the overlapping DeAndre Yedlin’s low cross found Dwight Gayle in the box. His first-time effort cannoned off the bar, though, and the Hammers hacked away the danger.
Michail Antonio headed over and Arthur Masuaku saw a long-range shot parried by Elliot, but it was the Magpies who should have led at the break. Gayle’s fine control and lay-off allowed Matt Ritchie to take aim, but his curling strike came back off the upright, and Diamé’s follow-up flew over.
Then, after a fine counter-attack instigated by DeAndre Yedlin’s powerful run, Gayle swept a Ritchie centre over the crossbar as United ended the half in the ascendency.
Arnautovic fired just wide shortly after the restart, but it took just seven minutes for the Magpies to edge in front. Some fantastic work down the left from Atsu created the opening – his nutmeg on Pablo Zabaleta allowed him to skip into the box and cross low, and Diamé was there to blast into the top corner for his first goal of the season.
But then the Magpies were indebted to Elliot as they preserved their lead. Antonio burst into the box and was brought down by Clark, though replays showed that the infringement had taken place outside the box. Referee Lee Mason, though, pointed to the spot, but Andre Ayew saw his penalty palmed away brilliantly by Elliot, diving to his left.
And on the hour, United were rewarded for their resilience. A brilliant counter-attack involving Yedlin and Gayle culminated in Joselu finding space for a low cross from the left, and Atsu timing his arrival in the box perfectly to tuck away his side’s third and send the Newcastle fans behind that goal into raptures.
The game was far from over at that point, and Ayew pulled one back for David Moyes’ side with just over 20 minutes remaining, slamming home the rebound after Elliot had saved former United frontman Andy Carroll’s header.
But despite plenty of late pressure from the Hammers, Benítez’s men held on to claim the points and provide some welcome festive cheer for those supporters who made the long trip down to the capital.