Roared on by the Magpies’ first capacity home crowd of 50,000 for 17 months, Newcastle started brightly as Callum Wilson headed home Allan Saint-Maximin’s teasing delivery.
An intended cross by Aaron Cresswell crept in to quickly get West Ham level before Jacob Murphy’s header restored Newcastle’s lead at half-time.
But David Moyes’ men showed why they finished sixth ahead of Tottenham and Arsenal last season after the break.
Newcastle could not live with the pace and inventiveness of Said Benrahma and Michail Antonio.
They combined to get the visitors level once more on 53 minutes as Benrahma stooped to head home Antonio’s cross.
Antonio then hit the post with a header from point-blank range, but on the rebound Murphy tripped Pablo Fornals inside the box.
On his Premier League debut, Freddie Woodman saved Antonio’s penalty, but Tomas Soucek pounced on the rebound to put West Ham in front.
Three minutes later Benrahma fed Antonio on the counter-attack and this time he made no mistake with a thumping finish to move level with Paolo di Canio as West Ham’s all-time top goalscorer in the Premier League.
“Not bad for a right back,” Antonio, who has played in a number of positions including in defence before establishing himself as West Ham’s main striker, told Sky Sports.
“I had a couple of opportunities before that I didn’t take but getting a goal on the first game starts the season off for me and hopefully I can keep going and keep scoring more.”