With this win, West Ham eased the pressure on new manager Julen Lopetegui.
Thomas Soucek gave West Ham the lead in the 10th minute with a header and the visitors reached halftime still in front despite the hosts having a succession of good chances, Reuters reported.
Newcastle began the second half on top but were rocked on their heels when Aaron Wan-Bissaka broke forward to fire West Ham s second after 53 minutes -- his first goal for the club.
West Ham grew in confidence and thoroughly deserved their best victory of what has been a disappointing season so far under Spaniard Lopetegui. They remain 14th place with 15 points while Newcastle are in 10th place with 18 points.
Former Spain and Real Madrid manager Lopetegui s style of play has struggled to win over West Ham s fans and two poor performances before the international break left his side only three points above the relegation zone.
Some media reports suggested Lopetegui was two games from losing his job but the his side responded with an energetic display and clinical display to send the away fans home happy.
"I said we needed a performance before the game and I said we needed to go out and show it and I think we did that," West Ham captain Jarrod Bowen said.
"Newcastle always score at home so to keep a clean shoot and score twice. We had to be brave. I think this was more like the level that it takes to play for this club.
"I think this is a really big turning point in the season."
Had Newcastle not had an early goal by Alexander Isak ruled out for offside, it could have been a tough night for West Ham.
But shortly afterwards, Soucek was left completely unmarked in a crowded penalty area to plant a header into the goal from a corner and West Ham were immediately galvanised.
Newcastle, who had won three successive games in all competitions, should have levelled with Sean Longstaff heading a decent chance straight at West Ham keeper Lukasz Fabianski and Lewis Hall driving a shot across the face of the goal.
Anthony Gordon also should have done better than to shoot straight at Fabianski after a defensive error while Isak volleyed a chance just wide after great work by Bruno Guimaraes.
West Ham s second goal took the sting completely out of the hosts. Wan-Bissaka made a powerful run forward from deep and was played in on goal by Bowen s astute pass before placing his shot past Nick Pope and in off the post.
Newcastle failed to muster much of a response as they missed the chance to move into sixth place.
"We were the dominant team at halftime and the game would have been very different if we had equalised in the first half," Newcastle manager Eddie Howe said.