Published: 2019-08-27 03:59:02 BdST
New Zealand had batted on for five overs in the morning, allowing BJ Watling to complete a century before declaring their first-innings closed on 431 for six in reply to Sri Lanka's 244.
That gave the tourists, who lost the opening Test in Galle, a lead of 187 with 91 overs of play left and their bowlers provided the early strikes they needed to reduce Sri Lanka to 32 for five.
"A great effort to push for victory and ultimately come out on the winning side," New Zealand captain Kane Williamson said at the presentation ceremony.
"Naturally when the game starts coming so close, and the light's always a factor here as well this time of the year.
"But it was an outstanding effort from the first innings itself. And then the batters scored at a rate that allowed us to move the game forward. Deserve to be 1-1."
The hosts did not have regular captain Dimuth Karunaratne available to open the innings after he suffered a torn quadriceps while fielding.
He was unable to bat higher than number seven, though when he did take to the field, he and Niroshan Dickwella batted resolutely for a 51-run sixth-wicket partnership that gave Sri Lanka hopes of a draw.
Karunaratne fell lbw for 21 to seamer Tim Southee, however, while wicketkeeper Dickwella, who had suffered a finger injury, delayed the inevitable a little longer with a patient 51.
The Sri Lanka skipper blamed his side's batting in the first innings for defeat.
"I think it was a pretty good wicket," he said. "We needed to be patient and put a big score, 240-odd wasn't enough.
"We need some partnerships, we keep losing wickets regularly. That's the key ... once the batters get a start, we need to get a big one."
Watling remained unbeaten on 105, his seventh Test century, when captain Kane Williamson declared.
Rain had allowed just 66 overs on the first two days of the match, and 48 overs on the fourth.
The teams next play three Twenty20 internationals, starting in Pallekele on Sunday.