Kane Williamson and BJ Watling testing protocol partnership sixth of slipping on the fourth day brought the Kiwis back into the game after they trailed by 135 on first innings in Wellington.
Mark Craig took 4-53 as the hosts bowled Sri Lanka for the 196th
"The last few times we played some outstanding cricket," said New Zealand captain Brendon McCullum.
New Zealand does not have a series of tests since lost beaten England in May 2013.
Since then, the Kiwis won in the West Indies and India defeated West Indies away and shot against Bangladesh and Pakistan.
Continue to 45-1 in search of an improbable 390 for victory, Sri Lanka slipped to 110-5 lunch and New Zealand wrapped up victory with four sessions to spare.
McCullum said: "To fight our way out of an incredibly fragile situation, not only to save the test, but to go on and win the way we did is a testament to the work these guys off the field."
New Zealand beat Sri Lanka by 193 runs to win Test series 2-0
4/
5
Oleh
Unknown