Isaac Hayden headed home in the 94th minute.
After a low key affair where both sides failed to create many clear opportunities, it was a last-ditch effort which gave Newcastle the spoils.
Story of the game
Hayden's dramatic last-second winner sent the Geordie fans into meltdown as well as Steve Bruce.
Bruce could not hide his delight as he found himself running on the pitch to celebrate the last gasp winner.
Newcastle United should have taken the lead after 22 minutes as Emil Krafth picked out Joelinton six-yards out but his header cannoned back out off the bar.
After 34 minutes Reece James played a delightful ball behind Ciaran Clark to release N'Golo Kante who raced towards goal but was stopped by Martin Dubravka as the Slovakian stood tall.
Matt Ritchie delivered a perfect in-swinging cross from a free-kick for Federico Fernandez, however, the Argentine could not direct his header goalwards as it ended up flying high over the bar.
Willian had the first chance of the second-half as Tammy Abraham capitalised on a sloppy pass before playing in Willian but after creating some space for himself in the box he dragged his effort well wide.
Sean Longstaff had been on the pitch a few minutes before he sliced a pass behind his defence giving Abraham a one-on-one with Dubravka but the number nine lost his footing and fired wide.
Abraham thought he had opened the scoring with eight minutes left to play as he flicked an effort over the onrushing Dubravka only for Ritchie to race back on the line and clear the danger.
In the 83rd minute, Chelsea broke quickly before Newcastle half-cleared their lines, however, it was only to the edge of the are where Emerson smashed the ball agonisingly wide of Dubravka who was stranded.
With seconds remaining Allan Saint-Maximin crossed to the back post where Hayden had found space before heading into the far corner to send St James' Park into delirium.
Newcastle holding firm
Despite losing another defender through injury after only eight minutes when Jetro Willems was stretchered off, the Magpies stood strong.
Newcastle restricted the Blues to only long-range efforts which failed to test Dubravka all game as the Magpies' back five ushered their penalty box superbly.
Newcastle's three centre backs are all very experienced in the Premier League, which is beginning to show as Jamaal Lascelles' return from injury shone through with his leadership.
Confidence is growing
After Joelinton's first home goal against Rochdale during the week, he seemed like a much better player against Chelsea.
He saw a header crash off the bar in the first half and won a number of aerial duels as well as bringing players into the game which is what he has been criticised for in recent weeks, leaving himself isolated.
As well as Joelinton, Miguel Almiron continues to go from strength to strength and Federico Fernadez and Clark showed how much better they feel.
Fernandez has been an ever-present this season and Clark got his place back after returning from injury which shows the confidence Bruce has in every player.
Man of the Match
It was between one of Newcastle's three centre backs as they coped with Abraham and co all game.
It is Ciaran Clark that just edge it with his crucial interceptions when players were running at the defence as well as organising the full-backs all game.