Martin Guptill was 39 not out with Tom Latham on 21 as the openers posted their third consecutive half-century stand in the series. Guptill brought up their 50 partnership by clubbing Angelo Mathews over the rope for six.
Mathews, with his medium pacers, had shared the new ball with Suranga Lakmal and proved economical but not threatening with four maidens and only four runs off his first five overs.
But as Guptill and Latham warmed to their task, his next two overs yielded 16 runs.
After resuming at 264-7 Sri Lanka lost their last three wickets for 28 runs, with captain Mathews scoring half of them.