BJ Watling scored an unbeaten half-century and shared a key partnership with Tim Southee to give the Blackcaps a second-innings lead of 177 over Sri Lanka at stumps on the third day of the first test.
Watling was on 63, and Will Somerville on five, when bad light stopped play 15 minutes before the scheduled close with New Zealand 195/7 in Galle.
The tourists were reeling at 25/3 but Tom Latham made 45 and Watling produced a fighting half century to put New Zealand in a commadning position.
- Ajaz Patel leads New Zealand fightback with five wickets on day two
- Ross Taylor rescues New Zealand on day one of first test
Earlier, Sri Lanka added 40 runs to their overnight score of 227/7 before losing their last three wickets in the morning session.
New Zealand, who made 249 in the first innings, were undone by the Sri Lankan spinners in their second spell as well.
Offspinner Dhanjaya de Silva drew first blood when Jeet Raval (4) was caught in the covers after trying to check his drive.
Captain Kane Williamson had fallen for a third ball duck in the first innings and he looked uncharacteristically ill at ease in the second as well.
The right-hander made four before charging out against Lasith Embuldeniya and Kusal Perera, positioned at mid-on, took an off-balance catch to claim a prized scalp.
In his next over Embuldeniya, who has the leading figures of 4-71 from 29 overs, dismissed Ross Taylor (three) to further peg back the tourists.
Latham staged a brief recovery job with Henry Nicholls who contributed 26 before both departed, leaving Watling as the last recognised batsman.
The wicketkeeper hit five boundaries in his patient knock while quick bowler Tim Southee chipped in with 23.