On a breathless final day at Trent Bridge, Bairstow made the second-fastest century by an England batter in Test cricket as the hosts strolled to what should have been a challenging target of 299 from 72 overs.
Bairstow's outrageous hitting in the spell after tea took him to three figures from 77 balls, only just missing the England record of 76 balls that has stood for 120 years.
He was eventually out for 136 from 92 balls, having clubbed 14 fours and seven sixes in front of a delirious full house.
It was left to captain Ben Stokes, who ended 75 not out, to complete the win with 22 overs to spare. England had scored at almost a run a ball.
It sealed a remarkable turnaround from New Zealand posting 553 in their first innings after being asked to bat. It is the highest total England have conceded in a Test which they have gone on to win since 1894.
They take an unassailable 2-0 lead in the series, vindicating the freewheeling approach of new captain Stokes and coach Brendon McCullum.
The home side can complete a clean sweep in the third and final Test at Headingley next week.
The 17,000 people who grabbed the free tickets on offer knew England had a chance of pulling off a special win, but no-one could have predicted the way New Zealand would be steamrollered in such spectacular fashion.
From 224-7 overnight, leading by 238, the Black Caps edged to 284 all out, leaving England the stiff task of scoring at more than four an over.
The home side had the benefit of a flat pitch and New Zealand being without injured fast bowler Kyle Jamieson. Even then, the run-chase was truly staggering.
England had been adamant about their intent to pursue any target and this was an awesome demonstration of what they can be capable of under Stokes and McCullum.
It resulted in victory in one of the most entertaining matches of all time. The 225 fours and 24 sixes is a new record for the most boundaries hit in a single Test.
At the centre of it all was Bairstow, who played one of the great innings by an England batter.
Though he could not be there at the end, he was given a huge hug by Stokes, then left to a spine-tingling standing ovation.
In terms of England's early progress in the Stokes-McCullum era, Bairstow has been one of the last to taste success. When he did, he produced arguably his finest moment in an England shirt.
He was joined by Stokes at 93-4, with 206 required from less than 47 overs and New Zealand favourites. England took tea at 139-4 with Bairstow 43 from 48 balls.
What followed bordered on the ridiculous. Bairstow began by hitting Trent Boult over his head for six, then hooked Matt Henry into the stands. Wherever New Zealand bowled, he belted the ball to the boundary.
At one stage, Bairstow had taken 59 runs from 29 balls and was on course to beat Gilbert Jessop's 76-ball record for England's fastest ton. Three figures eventually came, one ball too late, by punching Tim Southee through the off side.
The carnage did not end there. Off-spinner Michael Bracewell was carted into the leg side, all while Stokes, struggling after jarring his knee, played second fiddle.
When Stokes' mobility returned, he smashed the biggest hit of the lot by sending Bracewell into the top tier.
A stand of 179 in just 20 overs was ended when Bairstow tickled Boult behind. Ben Foakes joined Stokes, who crashed the winning boundary.
Given what was to unfold, it seems ludicrous to think New Zealand had the better of the first part of the day.
Daryl Mitchell trusted the tail, moving from his overnight 32 to 62 not out. His last-wicket stand of 35 with Boult looked vital.
England, typically, began with positivity. Alex Lees hit the first two balls of the innings for four, only for Zak Crawley to edge Boult.
Every time England built momentum, they were pegged back. Ollie Pope was caught behind, Joe Root tapping a return catch to Boult was a huge blow and Lees poked at Southee to end his attractive 44.
Realistically, Bairstow and Stokes were England's last chance. What followed was simply magnificent.
England captain Ben Stokes: "I can't take too much credit for that. For all five days, the boys were phenomenal with bat, ball and in the field.
"I think today was set up perfectly for the way we want to go about things looking forward. We don't want to back away and stand still.
"Today just wow, unbelievable. I don't know what to do. It's not just about today, it's about the four days before. The work ethic everyone had before today was fantastic. You don't win from just one day. The way we fought back after 500 on the board.
"Incredible, incredible Test match. Huge testament to everyone's character and resilience."
New Zealand captain Tom Latham at the post-match presentation: "At tea it was still in the balance, but the way Jonny and England played was outstanding and all credit to them.
"It will take a while to sink in, the emotions are raw at the moment and the boys are gutted so we will take some time away."
England batter Jonny Bairstow: "Look at the crowd which has turned up on day five of a Test match at Trent Bridge - 13,000. People question Test cricket at times and the way in which it is played over a period of time. But there's been more than 500 scored in both first innings and 300 chased down in the last innings. If that isn't an advert for Test cricket, I don't know what is.
"It was fantastic to have such a crowd on day five. It was full of buzz, everything you want in Test cricket. It was so fresh - it was great."