Only an unbeaten Rachin Ravindra stands in the way of a Sri Lankan victory in the first test in Galle.
Chasing 275 for the win, the Black Caps kept losing wickets mainly to Sri Lankan spinners Prabath Jayasuriya (3-66) and Romesh Mendis (3-83), who became more difficult as day four wore on.
LATEST HEADLINES:
New Zealand were 207-8, just 68 runs from their target, at stumps on Sunday at Galle International Stadium, with the home side closing in on a win.
Ravindra hit nine fours and a six in his defiant knock, while Ajaz Patel was yet to score at the other end having faced 15 deliveries.
Patel has a batting average of just over 11 and a high score of 35.
Earlier, Patel ran through the bottom half of the Sri Lanka lineup as the hosts reached 309 before being all out.
After Saturday's rest day due to the presidential election in the country, Sri Lanka resumed on 237-4 hardly anticipating a batting collapse in which their last six batters managed a combined 72 runs.
Left-arm spinner Patel removed Sri Lanka captain Dhananjaya de Silva (40) and Angelo Mathews (50) claiming five of the last six Sri Lankan wickets to finish with figures of 6-90.
New Zealand opener Devon Conway fell early for four in their chase and the tourists kept losing wickets every time a partnership began to bloom.
Tom Latham (28), Kane Williamson (30) and Tom Blundell (30) got starts but could not convert them into big scores.
The usually reliable Daryl Mitchell was out for eight and Glenn Phillips four, while Mitchell Santner and Tim Southee each fell for two, leaving Will O'Rourke as the only batter remaining.
While the target is not beyond New Zealand's reach, Sri Lanka will bank on their spinners to get the job done on a day five pitch.