Sri Lanka beat the Black Caps by 63 runs in the first test to take a 1-0 lead in the two-match series in Galle.
New Zealand lasted just four overs on day five before being dismissed for 211 in pursuit of 275 for victory.
With only two wickets in hand and needing 68 more runs to win, the Black Caps had their hopes pinned on Rachin Ravindra who started the final day unbeaten on 91.
Ravindra could only add one run to his overnight score before spinner Prabath Jayasuriya had him out LBW.
Number 11 batter Will O'Rourke lasted six balls before Jayasuriya bowled him for a duck.
Jayasuriya (5-68) and Ramesh Mendis (3-83) shone with the ball for the hosts.
Black Caps captain Tim Southee told Sky Sport Galle was a tough place to tour.
"There's plenty of positives for us to take away from it but also disappointing to come out on the wrong side.
"If you look at that first innings we lost our last five wickets for not many, this part of the world the deeper you go the harder it becomes so that first innings was a bit disappointing that we didn't eek out a few more through the tailenders after the position we got ourselves into."
Southee said the continued progress of fellow pace bowler Will O'Rourke, who took eight wickets in the Test, was pleasing.
"He's got a lot of attributes that set him up for a lot of success at this level and we've seen that in the short sample size we've seen in Test cricket and for him to come here, a part of the world he hasn't played before, and walk away with eight wickets is a great effort in a wicket that wasn't offering much for pace bowling so he's got a huge future."
The second test, also in Galle, begins on Thursday.