Shreyas Iyer and Wriddhiman Saha struck half-centuries on Sunday before India declared its second innings on 234-7 on day four of the first test against New Zealand to set the tourists a target of 284 in Kanpur.
Iyer scored 65 runs, while Saha was unbeaten on 61 runs as they resurrected the Indian innings from a precarious 51-5.
At stumps, New Zealand was on 4-1 with Tom Latham on 2 and William Sommerville on nought after losing Will Young (2) shortly before the close of play.
Earlier, India had reached 84-5 at lunch after Kyle Jamieson (3-40) and Tim Southee (3-75) ran through the Indian top-order in the morning.
Cheteshwar Pujara (22) nicked off his gloves down leg side off Jamieson. Southee had Mayank Agarwal (17) caught at slip and then trapped Ravindra Jadeja lbw for nought.
Azaj Patel (1-60) trapped Ajinkya Rahane (4) lbw to reduce India to 51-5 after starting from an overnight 14-1.
Then, Iyer put on 52 runs for the sixth wicket with Ravichandran Ashwin (32) on either side of lunch and rescued the Indian innings.
Following his debut hundred in the first innings, Iyer's half-century in the second innings came off 125 deliveries and included eight fours and a six.
Sunil Gavaskar was the last Indian batsman to score 50-plus in both innings of his debut test, a feat he managed against the West Indies in 1971 .
"I had been in this situation before as well in domestic cricket. My mind set was to play the session and play as many balls as possible. I wasn't thinking too far ahead," Iyer said.
He also became the first Indian batsman to score a hundred and a half-century on his test debut.
"It feels good (to have that record) but the most important thing is to win the match... We felt that 250 including the first innings lead would have been a good score, so we're very happy with where we are now," Iyer added.
Jamieson bowled Ashwin after India crossed 100. Iyer then added 64 runs with Saha as they helped India reach a defendable total.
Southee dismissed Iyer before tea as India reached 167-7 at the break.
Saha scored his sixth test half-century and put on 67 runs with Axar Patel (28 not out) for the eighth wicket.
India declared with little time left in the day but Ashwin managed to remove Young before stumps. The ball seemed to be missing leg but the batsman ran out of time to use a DRS review.
New Zealand will need 280 runs on the final day for victory.
India scored 345 in the first innings thanks to Iyer's 105 and New Zealand was bowled out for 296 in reply as Axar Patel took 5-62 on day three.