Dushmantha Chameera, 23, playing just his third test, produced a concerted spell of accurate, short-pitched fast bowling to reduce New Zealand from 81-0 to 89-4 and give Sri Lanka the upper hand in a match the home side had previously sought to dominate. Chameera finished the day with his first test five-wicket haul and career-best figures of 5-47.
New Zealand allrounder Mitchell Santner, also 23 and playing his third test, then batted 2-1/2 hours for 38, sharing a 39-run partnership with Brendon McCullum (18) and a 40-run stand with B.J. Watling (28) in an effort to rally New Zealand after more experienced players had failed.
At stumps New Zealand was still 60 runs behind Sri Lanka with Doug Bracewell 30 not out.
"Obviously we haven't batted the way we would have liked to and the way we should have," Guptill said. "We were off to a great start and then we had a crazy 20 or 30 minute period there when we lost a few wickets quickly.
"But the way we fought back shows we're not too far behind the eight ball."
Neil Wagner's 17 included a six off Chameera, which flew more than 100 meters and landed on the street outside Seddon Park before he fell to the last ball of the day.
New Zealand's collapse, precipitated by Chameera, was sudden, severe and unexpected. Guptill and Tom Latham (28) had produced their third-straight partnership of 50 or more — the first time since 2001 a New Zealand opening pair has achieved three consecutive half century partnerships — and had steered their team comfortable to 81 without loss.
Chameera captured the important wickets of Latham for 28, Kane Williamson for 1 and Ross Taylor for 0 to leave New Zealand struggling and to support theories that Sri Lanka's total was more imposing than it seemed after it lost the toss Friday and was sent in on a green and seaming pitch.
Guptill and Latham reached 61-0 in barely 80 minutes before lunch to open New Zealand's chase and had gone on to 81 in 99 minutes when the hosts' innings began to unravel.
Latham tried to turn a ball from Chameera which rose sharply at his hip and steered it directly to Dimuth Karunaratne at leg gully who first juggled, then pocketed a sharp chance.
Only nine balls later Williamson, playing on his home, fell to a loose shot he to Suranga Lakmal on the leg-side.
Guptill, who looked comfortable posting a half century from 77 balls with nine fours and a six, attempted to hoist a Herath ball down the ground for six but edged it to Angelo Mathews at first slip.
Chameera then had Taylor caught behind.
The luckiest man on Saturday was Lakmal who, during his innings of four for Sri Lanka, fended a short ball from Neil Wagner which bounced back onto his wicket, heavily rapping middle stump without dislodging the bails. Lakmal was out next ball.
BRIEF SCORES (FULL SCORECARD)
Sri Lanka 1st Innings: 292 (Angelo Mathews 77, Milinda Siriwardana 62; Tim Southee 3-63, Trent Boult 2/51, Doug Bracewell 2/81).
New Zealand 1st Innings: 232 for 9 (Martin Guptill 50; Dushmantha Chameera 5/47, Rangana Herath 2/75).