Hammers boss Julen Lopetegui would have been delighted to see his side make an impressive start, with Tomas Soucek heading home from Emerson Palmieri's corner to net his third goal of the season.
After taking time to gather themselves, Newcastle started to grow into the contest as the half went on, going close to restoring parity on a couple of occasions.
Anthony Gordon saw his golden chance saved after he pounced on Jean-Clair Todibo's mistake, before Alexander Isak drilled a powerful strike just wide of Nick Pope's right-hand post.
However, the momentum Newcastle built before the break was halted by Aaron Wan-Bissaka's first West Ham goal in the opening stages of the second period.
Wan-Bissaka's strike ultimately knocked the stuffing out of Newcastle, who failed to register a single shot on target in the second period.
As a result, Eddie Howe's side fell to just their second home defeat of the season, while West Ham celebrated the end of their four-game winless away league run.
The win has moved West Ham up to 14th spot in the Premier League table, leaving them six points clear of dangers and three points adrift of 10th-placed Newcastle.
NEWCASTLE UNITED VS. WEST HAM UNITED HIGHLIGHTS
Soucek goal vs. Newcastle (10th min, Newcastle 0-1 West Ham)
West Ham find the breakthrough from a corner. Newcastle fail to do enough to stop Soucek from attacking Emerson's out-swinging corner, giving the midfielder the chance to direct his header into the far corner.
goal vs. Newcastle (53rd min, Newcastle 0-2 West Ham)
West Ham have a second! Wan-Bissaka makes a lung-bursting run on deep to create an option for Jarrod Bowen. The full-back receives the ball on the right side of the box, before he steadies himself to drive a low shot into the far corner.
MAN OF THE MATCH - JARROD BOWEN
West Ham had a number of contenders for the Man of the Match award after they produced a complete team performance at St James' Park.
With that said, we have picked out Bowen following an impressive display where he provided the assist for West Ham's second goal.
The England international completed 94% of his passes, completed a couple of dribbles and created a total of three chances, highlighting the importance influence he had on the visitors' attacking efforts.
NEWCASTLE UNITED VS. WEST HAM UNITED MATCH STATS
Possession: Newcastle 52%-48% West Ham
Shots: Newcastle 18-15 West Ham
Shots on target: Newcastle 2-6 West Ham
Corners: Newcastle 8-3 West Ham
Fouls: Newcastle 11-8 West Ham
BEST STATS
WHAT NEXT?
After enjoying a successful trip to the North East, the Hammers will return to the London Stadium for Saturday's difficult home clash against Arsenal.
As for the Magpies, they will be looking for a positive response when they face Crystal Palace in Saturday's meeting at Selhurst Park.