Mohamed Diame and Ayoze Perez scored in the last 10 minutes as Newcastle came from behind to snatch a late victory at promotion rivals Brighton.
Brighton looked set to open up a four-point lead over the Magpies at the top of the Championship table thanks to an early penalty from Glenn Murray.
But Diame equalised when Christian Atsu's shot looped up off his boot.
And then Atsu crossed from the left for substitute Perez, who had only come on seven minutes earlier, to fire home.
The victory moves Newcastle back to the top of the Championship table, two points above Brighton.
The Seagulls were clearly fired up for this top-of-the table contest and made a terrific start, camping in the Newcastle half and forcing Karl Darlow into two saves before he was beaten by the spot-kick from Murray, who had been fouled by Ciaran Clark.
But left-back Sebastien Pocognoli was forced off with an early injury to be replaced by Chelsea loanee Fikayo Tomori and Newcastle took advantage of the disruption.
They started to dominate possession with Atsu looking dangerous on the right, but failed to really trouble Stockdale until first half stoppage-time when the Brighton goalkeeper had to deny Matt Ritchie and Atsu.
Although Paul Dummett brilliantly cleared off the line from Lewis Dunk at the start of the second half, Brighton became careless but Yoan Gouffran failed to capitalise on mistakes by Steve Sidwell and Stockwell.
Brighton had their moments but Newcastle looked the more dangerous side, even though they were let down by poor finishing or kept out by Stockdale.
However, after substitute Daryl Murphy had been denied by another save from the Brighton goalkeeper, Diame equalised in bizarre style, as Atsu's shot hit a colleague on its way to deflecting off his foot and finding its way into the roof of the net.
Atsu was a constant menace to the Seagulls and it was no surprise he was involved in the winner.
Magpies' tough run
Given their next few fixtures, that win was vital for Newcastle, who face every other team in the current top seven in the next few weeks.
They travel to third-placed Huddersfield, who now trail them by eight points, on Saturday and then go to Reading next Tuesday and by the middle of April also have to face Fulham, Sheffield Wednesday and Leeds.
By contrast, Leeds, Derby and Norwich are the only other sides in the top half of the table who Brighton will face in their remaining 12 games.
The Seagulls are trying to win their first promotion to the top flight since 1978-79 after missing out so cruelly last season. Having been pipped on goal difference by Middlesbrough, they then lost to Sheffield Wednesday in the play-off semi-finals.