The Black Caps have yielded the ODI series to Sri Lanka after a commendable attempt to defend just 209 in game two in Pallekele.
Kusal Mendis (74 from 102) led the home side to a three-wicket win but they took 46 of the allotted 47 overs to get there on a slow wicket.
With Sri Lanka at 163 for seven and needing a further 47 for victory, the game was in balance before number nine Maheesh Theekshana (27 from 44) helped Mendis etch out the victory and a 2-0 series lead.
Michael Bracewell finished with 4-26, his best ODI figures, in a losing effort.
For Sri Lanka, it is their fifth ODI series win in 2024.