Bairstow smashed 106 to lift England to 305-8 in their final group game at the Riverside Ground, though the total could easily have been bigger but for a middle-order collapse.
New Zealand wobbled early in their chase, losing both openers cheaply, before a couple of run-outs effectively derailed them and they were all out for 186 in 45 overs.
England will face either holders Australia or twice champions India in the semi-finals at Edgbaston.
"We knew these two games were must win to give ourselves the best opportunity of reaching the semi-final," Bairstow said after collecting the man-of-the-match award.
"We knew the performances in the last couple of games weren't up to scratch. To play the way we have and hopefully keep it going into the semis is pleasing.
"We have got a couple days off...People will be sore after two gruelling games. Then we meet up and go again."
New Zealand could not qualify on Wednesday but, given their superior run rate, Pakistan would need a freak result against Bangladesh on Friday to leapfrog the Black Caps.
After England captain Eoin Morgan won the toss, Bairstow and Jason Roy threatened to replicate their Edgbaston heroics where the openers added 160 to set up a campaign-reviving victory over India.
Against a New Zealand attack missing Lockie Ferguson, who is nursing a tight hamstring, Bairstow and Roy looked unstoppable, scoring freely to bring up England's 100 in the 15th over.
Jimmy Neesham ended the 123-run partnership in the 19th over when Roy, having made a run-a-ball 60, was caught at short cover.
Bairstow needed 95 balls to bring up his 100 as he and Joe Root kept the scoreboard ticking over.
PITCH SLOWING
Trent Boult returned to dismiss Root for 24 and England suddenly began losing wickets regularly with the pitch showing signs of slowing down.
Bairstow chopped a Matt Henry delivery onto his stumps and Jos Buttler miscued Boult to Kane Williamson at mid-off.
Ben Stokes struggled to get going and managed only 11 off 27 balls. Morgan made 42 before Mitchell Santner took a stunning catch off Henry to dismiss the England captain.
New Zealand were rocked early in their chase, losing both openers by the sixth over with a meagre 14 runs on the board.
The onus was on Williamson (27) and Ross Taylor (28) to put the chase back on track but two run-ours, one fortuitous and another ill-judged, led to the dismissals of New Zealand's two senior batsmen.
Taylor's drive brushed Mark Wood's fingers before hitting the stumps at the non-striker's end with Williamson out of his ground and Taylor ran himself out going for a risky second.
Tom Latham made a fighting 57 but it was too late to effect the result.
"Not ideal to have three defeats, the recipe is simple but not easy," Williamson said.
"The margins on the scoreboard have looked big but for us it is important we look at it for what it is. We definitely need to be better moving forward.
"England did get the best of the conditions but they were the better team. They outplayed us in all facets."