Former captain Williamson hit 132 and Tom Blundell was last man out for 90 as the hosts fought back after being asked to follow on.
England were 48-1 in their second innings at stumps after opener Zak Crawley, on 24, was bowled by a delivery that nipped back from New Zealand captain Tim Southee.
Ben Duckett remained unbeaten on 23 and nightwatchman Ollie Robinson was on one, leaving England to score a further 210 runs on Tuesday’s final day for a 2-0 sweep after winning the first Test by 267 runs.
All to play for on Day 5. England require another 210 runs in Wellington 🏏 Tomorrow is FREE ENTRY, with play schedu… https://t.co/QZePAdM9Xo
— BLACKCAPS (@BLACKCAPS) 1677476336000
New Zealand need nine wickets to pull off only the fourth victory by a side following on in the history of Test cricket and square the two-match series.
The hosts resumed their second innings on Monday at 202-3, still trailing by 24, but Williamson led the charge with his 26th Test century.
Spinner Jack Leach took 5-157 for England, but it was batting star Harry Brook whose part-time seam bowling claimed the crucial wicket of Williamson.
After grinding down England’s bowlers, Williamson was finally caught down the leg side by wicketkeeper Ben Foakes off a fine edge after a sixth-wicket partnership of 158 with Blundell.
Williamson trudged off to hearty applause from the Wellington crowd after dragging New Zealand back into the match.
It was his second standing ovation of the day having eclipsed Ross Taylor in the morning session to become New Zealand’s most prolific Test batsman with 7,787 runs.
His partnership with Blundell helped New Zealand fight back after England declared their first innings at 435-8, then scuttled New Zealand for 209 before inviting the hosts to bat again.
New Zealand can join an elite club if they win — only England, twice, and India have won a Test after following on.
Williamson, who survived a close shout for a stumping when on 45, handed his side a fighting chance after frustrating England alongside Blundell with support from Henry Nicholls and Daryl Mitchell before lunch.
Blundell hit Broad to the boundary as New Zealand passed 400, then Williamson also smacked England’s seamer for four to bring up his hundred — his first since scoring two tons against Pakistan in December 2022.
After Williamson departed, New Zealand folded quickly.
Michael Bracewell went in sloppy fashion, run out for six as he inexplicably failed to ground his bat as Foakes whipped off the bails from Ben Stokes’s laser throw in the deep, when he should have been home comfortably.
New Zealand lost their last four wickets for just five runs, Blundell last out when he edged Leach to Root at slip going for a big hit.