Sri Lanka's hopes looked dead at 42 for four in the fourth over, but they plugged away and - as New Zealand had earlier - got through a boundary drought of more than five overs to give New Zealand a scare.
"Even though they lost wickets, they kept up momentum and went with the run rate all the way to the end," New Zealand batsman Colin Munro said, conceding Sri Lanka probably got a touch closer than the hosts may have anticipated.
Munro, in strong form for Auckland, relished a chance at No 3 and, overcoming a sluggish start, kept his head to finish with 36 in 26 balls.
That came after Martin Guptill and Kane Williamson shared New Zealand's fifth century stand for the first wicket, Guptill in particular responsible for a flying start.
He's in rare form, while Williamson, with his distinctly different methods, has a better strike rate than the tall Aucklander - 127.91 to 124.74. Book this in as New Zealand's opening pair for India.
But Sri Lanka's slow men, plus canny medium pacer Nuwan Kulasekara, put a stranglehold on the batsmen.
There was food for thought, on a slowish pitch - possibly not dissimilar to some the teams might encounter in India - in the work of the spinners, Jeffrey Vandersay and Sethan Jayasuriya, who combined for eight overs, taking two for 54.
New Zealand got 19 singles in successive deliveries. Boundaries were beyond them but the batsmen didn't throw the bat needlessly.
Munro and Ross Taylor - 22 not out off nine balls at the end - put some oomph into things and New Zealand rattled up 51 off the last five overs.
Danushka Gunathilaka and Milinda Sirawardana dug in after the early casualties before Ish Sodhi put in his application for a trip to India with a lovely googly to deceive the dangerous Gunathilaka.
At the halfway mark, Sri Lanka were on 86, just 11 runs behind New Zealand's comparative score, but five wickets worse off. It seemed too large a hill to climb, but they gave it some real cheek.
Sirawardana, a candidate for the success story of this tour, and Thisara Perera put on 49 in 31 balls; 35 were needed off the last four overs and suddenly it was tight.
Thirteen were required from the last bowled by Grant Elliott, and he was up to the job.
"It was always close. We almost got there. One big shot away but they bowled pretty well in the last four overs. Credit should go to them," Chamara Kapugedera said of New Zealand's bowlers.
Man of the match Trent Boult had the best figures, Sodhi the most interesting display and Mitch McClenaghan and Elliott the crunchy job at the death.
Now for Eden Park on Sunday. Sri Lanka need to win it to remain No 1. A series win will give New Zealand a boost from No 8.