The hosts were focused solely on not losing the second match in order to earn a 1-0 series win as they earlier won the first Test in Galle by 10 wickets.
Black caps were chasing the target of 363 on fifth day and started the day on 47 for four but got into trouble at the beginning of day as early run out of Thilan Samaraweera left them 63 for five.
Angelo Mathews and Prasanna Jayawardene took their side to 107 for five at lunch and took their partnership to 56 before wicketkeeper Jayawardene bowled to edge on 29 by leg-spinner Todd Astle.
Suraj Randiv failed to score but Mathews reached half-century. Mathews batted patiently through the first two sessions of the final day as he tried to lead Sri Lanka to draw the Test but Sri Lanka reached tea on 167 for seven.
Kiwis succeeded to dismiss Black Caps on 195 and equated the series by 1-1.
Tim Southee and Trent Boult took three wickets each while Doug Bracewell took two.