"It shows how hard this team works, how hungry they are to perform for their country and also the confidence we're starting to develop in the group."
Sri Lanka resumed at 45-1, chasing an improbable 390 to win and square the series. The highest fourth-innings total to win a test at Basin Reserve was 277 by Pakistan in 2003.
Nightwatchman Dhammika Prasana was out for six in only the second over of the day, brilliantly caught at second slip by Jimmy Neesham, who snatched the ball above his head to give Trent Boult the early breakthrough.
Kumar Sangakkara, who made 203 in the first innings, loomed as the man most likely to deny New Zealand's victory push, but fell for just five in contentious circumstances, cutting at a wide delivery from Boult which passed under the bat on its way to wicketkeeper BJ Watling.
There was no appeal from Watling or other players behind the wicket, but Boult made a half-hearted appeal that was turned down by the field umpire. New Zealand captain Brendon McCullum referred the decision to the television umpire.
The Hot Spot imaging technology did not register any contact between ball and the bottom edge of Sangakkara's bat but the Snicko audio technology revealed the faintest of noises and that was enough to overturn the field umpire's call and dismiss Sangakkara, who was clearly angry as he left the field.
The hosts moved closer to victory when Kaushal Silva (50) and captain Angelo Mathews (8) were dismissed in the last 15 minutes before lunch, sending Sri Lanka to the break at 110-5.
Silva battled throughout the morning to reach his seventh half century in tests in 174 minutes but fell to a slip catch by Mark Craig.
Mathews went on the last ball before lunch, acrobatically caught at slip by Kane Williamson, who lost the ball in the air but reclaimed it before hitting the ground.
Lahiru Thirimanne and Prasanna Jayawardene stayed together for 51 minutes at the start of the second session before wicketkeeper Jayawardene was out for 10.
The innings unfolded quickly from there. Dinesh Chandimal (13) and Rangana Herath (0) went to consecutive deliveries from Craig in the 62nd over.
Suranga Lakmal was run out for 6 and Nuwan Pradeep was bowled by Tim Southee to end the match.
The teams will now play seven-match one-day international series beginning in Christchurch on Sunday.AP