Newcastle maintained their unbeaten start to the season as they defeated Tottenham in a thrilling match at a packed and atmospheric St James' Park.
The hosts took a 37th-minute lead when Harvey Barnes superbly controlled a tricky side-footed finish after Lloyd Kelly had done well down the left and pulled the ball back.
But Tottenham levelled in the 56th minute. After Pedro Porro's shot had been deflected on to the crossbar moments earlier, half-time substitute Brennan Johnson had his shot sliced into his own goal by Newcastle defender Dan Burn.
Keeper Nick Pope then tipped over James Maddison's curled effort and Johnson fired over as Spurs piled on the pressure.
However, against the run of play, Newcastle regained their lead with 12 minutes left.
Joelinton started the move with excellent work in midfield and he released substitute Jacob Murphy who ran at the defence and crossed low for Alexander Isak to net the winner.
In another boost for Newcastle, Italy midfielder Sandro Tonali made his first Premier League appearance since October after he served a 10-month ban for breaching betting regulations.
The 24-year-old, who played in the away Carabao Cup second-round tie against Nottingham Forest on Wednesday, received a standing ovation from the home fans when he came on as a second-half substitute.
Follow live text and radio coverage of Sunday's Premier League matches.
Missed chances prove costly for Tottenham
The win lifted Newcastle up to fifth place on seven points - two behind leaders Manchester City and Liverpool.
"We're finding a way to win but in the long term we need to improve our performances," admitted boss Eddie Howe. "We can move forward with positive momentum and it was difficult but we managed to grind out a win.
"This does give us confidence and shows we're a very good team, but one that can improve. We need the players to believe and I think they do, but we still have a numbers of players that can make a difference out injured."
Tottenham would have gone second with a win, but are now 10th after losing for the first time in this campaign.
Boss Ange Postecoglou will be wondering how they left the north east without anything to show for their efforts, having been the better team for large parts of the second half and a spell in the middle of the opening period.
Spurs had two-thirds possession, 20 shots at goal compared to only nine from Newcastle, while the hosts scored from two of their three attempts on target.
After winning 6-1 and 4-0 in their past two home games against the Londoners, Newcastle nearly went ahead after only five minutes.
But having stolen the ball from Son Heung-min, Swedish striker Isak was denied by the woodwork when his superb chip left Guglielmo Vicario beaten.
Barnes, Emil Krafth and Kelly all had chances before a forced delay, which saw fourth official Darren Bond replace injured assistant Ian Hussin, stopped Newcastle's momentum.
At the other end Cristian Romero earlier had a header ruled out for offside and Wilson Odobert and Porro missed the target, with Pape Sarr forcing a good save from Pope.
They rued those spurned opportunities as, against the run of play, Barnes was given too much space to steer in his first goal of the season.
The introduction of Welsh winger Johnson at half-time looked to have transformed the game with Spurs well on top.
Their equaliser came after 10 minutes into the second half and, from there, it looked there would only be one winner. But Spurs got hit by another sucker punch as Murphy broke to tee up Isak for his crucial first goal of the campaign.
"We needed to kill the game off and we didn't - the game should have been over by then," said Postecoglou.
"We've not got the results from our performances, but ultimately it's three strong performances."
Emotional return to St James' Park for Tonali
Tonali was making only his 14th appearance for the club since his £55m move from AC Milan before the start of last season, but has quickly become a fan favourite.
Dozens of flags in Italy colours, with the word 'Sandro' written through the middle, were displayed before the match by the Gallowgate End, along with two huge banners that said 'Midfield maestro from Milano' in tribute.
Tonali received a great reception when he warmed up at the end of the first half, but that was eclipsed when he replaced Sean Longstaff in the 68th minute.
Newcastle had frustrations in the transfer window, notably a failure to agree a deal with Crystal Palace to sign England defender Marc Guehi, with four offers going up to £65m rejected.
However, the return to Premier League action for Tonali will be like a new signing for Howe.
"I didn't know that was going to happen with the wall of flags, so it was a brilliant surprise - visually it was incredible," added the Newcastle manager.
"Sandro was emotional and his performance when he came on was outstanding. It was just amazing from the fans, it does not surprise me, but it's so important that the relationship between players and supporters is so strong.
"It was very different to the Nottingham Forest game. We were in need of a spark and he gave us that."
Player of the match
After the opportunity to rate players has closed, the score displayed represents the average from all the submissions by BBC Sport users.