New Zealand need 107 for famous win in India despite Sarfaraz and Pant heroics
Fast bowlers Matt Henry and William O'Rourke took three wickets each to bowl out India for 462 in the final session in Bengaluru.
New Zealand skipper Tom Latham and Devon Conway came out to bat but only four balls were bowled and no runs were scored before bad light forced the players off, a heavy downpour began and stumps were called.
Rain also interrupted play towards the end of the first session, with around two hours lost on an action-packed day.
Sarfaraz, who struck 150, and the left-handed Pant, who hit 99, put on 177 runs for the fourth wicket to overhaul India's big deficit of 356 before the second new ball did the trick for the Black Caps.
Sarfaraz, a middle-order batter who hit his first ton in four Test appearances, fell soon after reaching 150 when he was caught at cover off Tim Southee.
O'Rourke denied Pant his century with a delivery from around the wicket that took the edge of the bat and rattled the stumps and then got KL Rahul out for 12 on the stroke of tea.
Pant came in to bat after resting on day three with a knee injury.
It was the same knee he hurt in a serious car crash in December 2022 that forced him out of action for more than a year.
Wickets kept tumbling as O'Rourke sent back Ravindra Jadeja and Henry wrapped up the innings with two in one over.
Before lunch, Sarfaraz punched a boundary off the back foot through cover off Southee to raise his ton, earning a hug from Pant and a standing ovation from fans and teammates.
India were bowled out for 46 in the first innings, their lowest total at home.
New Zealand's Rachin Ravindra then put the tourists ahead with 134, steering them to 402 all out.
The opening day's play was washed out due to rain.