B.J. Watling scored an undefeated half-century and shared a key partnership with Tim Southee to give New Zealand a second-innings lead of 177 over Sri Lanka at stumps on the third day of the first Test on Friday.
Watling was on 63, and William Somerville on 5, when bad light stopped play 15 minutes before the scheduled close with New Zealand 195-7.
Watling and Southee added 54 runs for the seventh wicket after Sri Lankan spinners ran through the batters to leave them 124/6. Southee departed for 23.
Left-arm spinner Lasith Embuldeniya finished the day with 4-71. Dhananjay de Silva took 2-16.
New Zealand's lead already looks a difficult challenge for Sri Lanka as batting on a spinning Galle pitch in the fourth innings has proved a tough task in the past.
"I think anywhere around 200, we are not too far from that at the moment," Kiwi batsman Tom Latham said about the total New Zealand hopes to defend.
"It's nice to have managed to build a few partnerships after losing a few early wickets. We are relying on these (lower-order) partnerships ... we can set a competitive total for the fourth innings."
Sri Lanka batsman Niroshan Dickwella was more optimistic, saying a score of about 230 is a possible chase.
"I think it's not hard to bat on this wicket, it's slow and spinning but we have done that before," Dickwella said. "I think our batters will raise their hands and do the job for the team."
New Zealand earlier ended Sri Lanka's first innings for 267, giving the hosts an 18-run lead over the Kiwis' 249 which they had wiped out by lunch.
But New Zealand's batting line-up struggled in the second session with spinners extracting more turn and bounce.
Captain Kane Williamson, who failed to score in the first innings, was out cheaply again for four runs when he was caught by Kusal Perera off Embuldeniya. Williamson stepped out to hit a flighted delivery from the left-arm spinner, mistimed it and was caught brilliantly by Perera who ran back from mid-off, leapt and took the catch.
Ross Taylor (3), top scorer in the first innings with 86, tried to hit a wider delivery from Embuldeniya past cover and was caught at slip by de Silva.
Opener Latham made 45 before de Silva lured him forward and had him caught at slip by Lahiru Thirimane.
Henry Nicolls was also caught at slip by Kusal Mendis off de Silva for 26.
Mitchell Santner was out just before tea, caught by Suranga Lakmal off Embuldeniya.
Sri Lanka resumed Day 3 on 227-7, with Dickwella sharing an 81-run eighth-wicket partnership with No. 9 Lakmal — after the pair came together on 161-7 — to give Sri Lanka its small lead.
The pair added 15 more runs for the day before Lakmal, who had been hit on the elbow two balls earlier by a rising delivery from fast bowler Trent Boult, edged one to the stumps.
He made 40 in 98 deliveries, including two sixes and three boundaries.
Dickwella was out for 61, caught by Williamson off-spinner Somerville. Dickwella hit three boundaries in his 12th Test half-century.
Spin bowler Ajaz Patel took 5-89, Somerville had 3-83.