The Magpies opened the scoring in just the sixth minute when debutant Jonjo Shelvey, who had joined from Swansea during the week, fired a lovely pass to the feet of Georginio Wijnaldum who touched it into the path of Ayoze Perez to pick this spot and curl him from the edge of the area.
Steve McClaren's men doubled their advantage less than 10 minutes later after Shelvey pinged a laser-like long ball out in front of right-back Daryl Janmaat who cut back for Wijnaldum to slot beyond Adrian.
In the end, however, Newcastle came out on top to momentarily move out of the bottom three prior to Swansea's win over Watford on Monday night.
For Slaven Bilic's Hammers, the defeat ended a three-game winning streak which aw them drop to sixth.
- Shelvey had a fantastic debut. Can he be the man to guide the Magpies out of the mire?
- Just a slight blip for West Ham but do they have a squad deep enough to push for a top-four finish?
Newcastle next head to Watford on Saturday in search of another three points while West Ham host the in-form Man City.
Three points for us! Love to play at St. James, love to score at St James, love to WIN at St. James!! pic.twitter.com/FkmQrfPzfM
— Ayoze Perez (@AyozePG) January 16, 2016
Greatperformance from the lads! A important win #3points ! Enjoy your weekend #NUFC#ToonArmypic.twitter.com/5Hqq7SyUXy
— Georginio Wijnaldum (@GWijnaldum) January 16, 2016
ADRIAN: @AdriSanMiguel was in fine form but left St James' Park disappointed < https://t.co/mu3n7fALAX#WHUFCpic.twitter.com/u5ERCIyLqk
— West Ham United FC (@whufc_official) January 18, 2016
Newcastle's McClaren on the Toon debut of Shelvey:
"That first pass forward created the first goal and that cross-field just gives you, because of the speed of it, that extra two seconds that the defence can't recover.
"That's the difference between top-quality midfield players and average ones. He's got the potential to be top. There's a long way to go, but it's a nice start."
West Ham boss Bilic on the performance of their opposition:
They have improved a lot recently, but still they were down and we were counting on the confidence to be on our side. Unfortunately, that wasn't the case.
"We have to give them credit, Newcastle, who started bright and good and everything, but definitely we helped them in that."
*Thanks to Opta
9 - All nine of Georginio Wijnaldum's Premier League goals this season have come at St James' Park. Comforts.
— OptaJoe (@OptaJoe) January 16, 2016