Tim Southee took 5-67 as New Zealand exploited an influential toss but Sri Lanka fought back to 9-275 at stumps on Saturday's opening day of the first Test in Wellington.
A late unbeaten 73 by wicketkeeper Niroshan Dickwella helped to swing momentum for Sri Lanka. Dickwella hit 10 fours but lost his last partner Kasun Rajitha to the final ball of the day.
Southee had claimed three wickets inside the first four overs, leaving the tourists at 3-9, as the ball swung in overcast and humid conditions at the Basin Reserve.
The innings was revived by a gallant fourth-wicket partnership of 133 between Dimuth Karunaratne (79) and Angelo Mathews (83), who frustrated the New Zealand bowlers for much of the first two sessions.
Southee claimed two more wickets after tea to stifle the Sri Lankan fightback and completed his eighth five-wicket haul in Tests.
"There's still four hard days to go," Southee said. "I think (the key) was just to pitch it up. Anytime you have the Basin on day one, historically over the last couple of years, there's been assistance for the new. Ball but, if you can get through that, it becomes easy."
With the new ball, Southee put on an outstanding swing-bowling display, dismissing Danushka Gunathilaka (1), Dhananjaya de Silva (1) and Kusal Mendis (2) in his first two overs.
The remainder of the first session and most of the second were dominated by Karunaratne and Mathews, who batted for 42.3 overs or almost three-and-a-half hours.
New Zealand resorted to a barrage of short-pitched bowling, led by third seamer Neil Wagner and then by Southee, who bowled around the wicket to try to force the batsmen to play, with fielders behind square.
Karunaratne and Mathews were both out, indirectly, to that tactic. Both were caught down the legside by wicketkeeper BJ Watling while attempting to play pull shots.
The partnership ended on 133 and the total at 4-142 when Karunaratne sparred at a short ball from Wagner, giving Watling one of his four catches.
Mathews fell similarly shortly after tea, lured into an injudicious pull by Southee.
While Southee completed his five-wicket bag with Mathews and captain Dinesh Chandimal's scalps, the Sri Lankan resistance didn't end.
Dickwella unleashed an array of innovative shots to reach his 10th Test half-century.