Cheteshwar Pujara, bogged down and able to score only 11 runs from 81 deliveries, fell to the last ball before the break, bowled while not offering a shot to a ball from Trent Boult which hit off stump.
At tea India was 78-2 in its second innings with Agarwal 52 not out and captain Virat Kohli due at the crease.
New Zealand built a 183-run first innings lead when it made 348, in an innings that ended at lunch, in reply to India's 165.
The pitch at the Basin Reserve which was troublesome when India batted first after losing the toss has dried out and hardened and was much less generous to seam bowlers on Sunday.
Boult was able to remove Prithvi Shaw (14) when India was 27-1. India's batsmen then looked relatively comfortable, if cautious, until Pujara fell just as tea was due at the exceptionally late hour of 4.47pm local time.
Delays for rain and bad light have pushed back the playing hours and that was exacerbated when India took an extra half hour to end New Zealand's first innings before lunch.
In the morning session Colin de Grandhomme and Kyle Jamieson put on 71 for the eighth wicket and Boult hit 38 from 24 balls as New Zealand's tail wagged and expanded its first innings lead.
New Zealand resumed Sunday at 216-5, just 51 runs ahead, and lost wicketkeeper B.J. Watling (14) to the first ball of the day. Tim Southee (6) was out soon after as New Zealand, at 225-7, risked falling short of the lead it wanted after bowling out India for 165.
But New Zealand's last three wickets added 123 runs and swung the balance of the game strongly back in its favor.
First Jamieson continued an outstanding debut, scoring 44 to follow his 4-39 in India's first innings. His was the highest score by a New Zealand No. 9 batsman on debut and a rebuke to the selectors who took so long to give him his chance.
The partnership between De Grandhomme, who made 43, and Jamieson revived the New Zealand innings. Their 50 partnership came from 67 balls in spite of the arrival of the second new ball.
Both fell to the spin of Ashwin and New Zealand's lead seemed to have peaked. But Boult played a cheeky innings, swinging freely and hitting five fours and a six on his way to 38 from 24 balls.
He finally fell to Ishant Sharma who took 5-68 — his 11th five wicket bag in tests.