Sri Lanka, set 390 to win, began the final day on 45-1 but were bowled out for 196, and lost the two-match series 2-0.
Kane Williamson and BJ Watling had laid the foundations for a declaration on day four with a world-record sixth-wicket stand of 365, allowing captain Brendon McCullum to declare.
Sri Lanka, needing to a win to avoid losing the series, had decided to go hard for the runs, but by lunch on the final day it became a battle to avoid losing.
The tourists got off to a terrible start as nightwatchman Dhammika Prasad departed to just the 10th ball of the morning.
Trent Boult found a thick edge outside the off-stump and James Neesham was on hand to see off Prasad for six at second slip.
The key wicket though was the next to fall ??? the great Kumar Sangakkara, whose dismissal was controversial.
The left-hander swung at Boult outside off, Watling gathered behind, and although the finger did not go up, McCullum reviewed and Sangakkara, who had scored a magnificent 203 in the first innings, was forced to depart for five.
Opener Kaushal Silva reached his 50 off 119 balls, but was gone just two later, edging Doug Bracewell to Mark Craig at second slip.
Lahiru Thirimanne was joined by Angelo Mathews, but the skipper did not last long, falling before lunch for just eight, Williamson pulling off an absolutely stunning diving catch off Bracewell at gully at the second attempt.
Sri Lanka gave up all hope of chasing down the runs, and Prasanna Jayawardene dug in effectively with Thirimanne.
But the keeper could not help himself when he got a loose one from off-spinner Craig, and he slapped it straight to Williamson at cover.
Craig then took two wickets in two balls. First Dinesh Chandimal (13) got a faint edge behind to Watling and then Rangana Herath followed lbw, although Suranga Lakmal survived the hat-trick ball.
Lakmal was next to go though as he was run out for six and victory was sealed when Tim Southee left Nuwan Pradeep’s (one) stumps in a mess, Thirimanne left high and dry on 62 not out.