New Zealand's Wagner keeps the faith to turn tables on England
The veteran quick took 4-62 and snared the final wicket at the Basin Reserve as New Zealand became just the fourth team to win a test after being made to follow on.
It came after he bled 110 runs in 13 overs in the series-opener in Mount Maunganui as Harry Brook and the English batsmen tore him to shreds on the way to a 267-run win.
Conceding 8.46 runs an over in England's second innings, Wagner's figures were the second least economical in test history.
More pain was to come in the first innings in Wellington, where he had 1-119 off his 21 overs.
But when the match was slipping away from New Zealand on Tuesday as Joe Root and captain Ben Stokes built a big partnership, it was Wagner that dragged them back.
The South Africa-born 36-year-old banged in bouncers to dismiss them both, setting up the game for its thrilling climax.
"We just went back to what Wags's biggest strength is and he bought into it," captain Tim Southee said of the short-pitched assault.
"He trusted it, even though it hadn't probably come off as well as he'd have liked in certain areas."
With New Zealand three wickets from victory, Wagner proved a safe pair of hands in the field, catching Stuart Broad for 11 when the tailender ramped high to third man.
An enthralled crowd gasped as wicketkeeper Ben Foakes pulled for the fence, then roared as Wagner bolted forward from fine leg and tumbled as he took the low catch.
The ninth wicket left only tailenders to bat, but James Anderson smashed Wagner for four to put England within two runs of victory.
Wagner held his nerve and had Anderson caught behind in his next over to secure the win, triggering dancing on the grassy terraces by jubilant fans.
Wicketkeeper Tom Blundell was nearly bowled over as a charging Wagner wrapped him in a bear-hug and roared in triumph.
"I got a bit of rhythm, something ticked which is nice," Wagner said of his winning spell.
"It's an amazing achievement, and obviously everybody contributed, so hats off to everyone."
England head coach Brendon McCullum, the former New Zealand skipper, doffed his hat to Wagner.
"It's a tough game and tough characters have to find a way and they do," McCullum said.
"Neil Wagner is one of the toughest that I've come across.
"He was good today. He was better than good, he was excellent. He turned the game on its head."