It was Wagner's combination with Kyle Jamieson that turned a final day that was heading nowhere fast into somewhere fast.
He bowled 11 overs straight on two broken toes numbed by a series of injections.
"People talk about the size of his heart but to have a couple of broken toes… he was in a lot of pain," man of the match Kane Williamson said. "We were trying to use him when the injection was taking effect. It was kind of unique for all of us, but in particular Neil.
"To keep coming out and wanting to contribute, his appetite and motivation to try to make a difference for the team is huge and we haven't seen it any bigger than the effort he put in across this test match.
"It was a very, very special effort from Wags, one that the team appreciated. We needed him out there and he delivered."
The night before Tim Southee, newly inducted into the 300 Club, said they might need one more "big push" from Wagner, but even he could not have anticipated such a long spell.
"He's quite difficult to take off," Williamson joked. "He did say, 'When I get my injections I'm much better off bowling long spells, OK.' I was like, 'What's different, Neil?'
"He loves it, he loves having the ball in his hand and it's very difficult to get it out."
The many and varying shades of test cricket presented themselves over five days at Bay Oval, leaving both skippers proud, exhausted and looking forward to resuming battle in Christchurch in the New Year.
"It was an incredible game of cricket; another incredible one against Pakistan," Williamson noted. "We're two very, very tight teams who've been going down to the wire. It was great to come away with the result and with the excitement of finishing so late in the piece."
The skipper, who scored 129 across the first two days, said they always felt they were in with a chance, if they could just prise apart his opposite Rizwan and centurion Fawad Alam.
"They were very much accustomed to the pace of the surface and didn't look like going anywhere anytime soon. They dug very deep to take the game to a place where – given those wickets [on day four] – it was tough to get across the line. [It was] incredible fight from them."
At one point it looked as if Pakistan might be shaping to chase victory, although Rizwan said they were always thinking of the draw after losing early wickets on day four.
Williamson, in perhaps his first acknowledgment of the importance of trying to make the World Test Championship final at Lord's in June, said he was prepared to lose in order to win.
"For us it was about trying to win at all costs going into that last session. In terms of the context of the Test Championship, losing it trying to win it was still a better bet [than locking down for a draw]."
The teams head to Christchurch in the New Year for the second test starting on January 3. A decision on Wagner will be made soon.
It's improbable that he will travel but as Rizwan said, with Wagner there are some things you cannot explain.