Tom Latham led New Zealand's solid response with an unbeaten 111 against Sri Lanka's first-innings total of 244 on the third day of the second and final Test in Colombo on Saturday.
The touring side, trailing 1-0 in the series after Sri Lanka won the opener in Galle, reached 196 for four in their first innings, trailing the hosts by 48 runs on a pitch offering sharp turn for the spinners.
Latham and BJ Watling, who was not out on 25, were at the crease and have added 70 for the unbroken fifth wicket to boost New Zealand.
Captain and batting mainstay Kane Williamson fell cheaply again, guiding paceman Lahiru Kumara to slip to be out for 20 after scoring just four in two innings in Galle. Experienced batsman Ross Taylor made 23.
Off-spinner Dilruwan Perera dismissed Henry Nicholls for 15 to reduce New Zealand to 126-4 at one stage but Latham and Watling kept them at bay for the rest of the final session.
Latham, whose highest Test score of 264 not out came against Sri Lanka last December, brought up his 10th Test hundred with a boundary through midwicket off Perera.
After rain allowed just 66 overs of play on the first two days, Dhananjaya de Silva struck his fifth Test hundred to help Sri Lanka post a respectable total.
Seamer Trent Boult, who had dropped an easy return catch from de Silva on Friday when he was on nine, dismissed the batsman for 109 to pick up his third wicket of the innings.
Boult's pace bowling colleague Tim Southee was the most successful bowler for New Zealand with figures of four for 63.