Wellington - Pakistan need 274 runs on the final day to win the second Test and complete a 2-0 series sweep against New Zealand after bowling the hosts out for 293 late on the fourth day.
Umar Gul ripped through New Zealand's tail, taking two wickets in two balls, as the hosts lost four wickets for seven runs late on Tuesday.
Last man Chris Martin faced Gul's hat-trick seeking delivery and kept it out with a French cut behind square to the enormous cheers of the small crowd at the Basin Reserve.
Tim Southee then smashed two sixes as he tried to push the lead closer to 300, before Gul had Martin caught behind for one. Southee ended 22 not out, while Gul finished with four for 61.
Pakistan had threatened to smother New Zealand's attempts to build a target that the home side's bowlers could then defend on the final day.
The game was disrupted for 23 minutes in the final session when rain forced the players off the field. They returned after 16 minutes but in comical scenes were then forced to turn and run for cover as another downpour swept across the ground.
Just as the ground staff had laid the first covers over the pitch, the rain just as quickly stopped and the players returned seven minutes later.
New Zealand suffered a blow in their quest for quick runs when the aggressive Jesse Ryder was bowled for 17 on the first delivery after the rain delay when he did not play a shot at a straight ball from part-time off-spinner Mohammad Hafeez.
James Franklin (six) also fell to Hafeez when he edged a ball to Younus Khan before Ross Taylor (52) and Reece Young (20)combined for a 60-run partnership that helped extend the lead before they both fell with the score at 268.
Young was caught in close by Azhar Ali, off Rehman, while Taylor was trapped in front by Gul, who then bowled Vettori for one and trapped Brent Arnel for a duck to set up the hat-trick opportunity.
Brendon McCullum and Martin Guptill had put on 120 for the first wicket -- only the second century-opening stand by New Zealand since 2004 -- to provide the perfect launch pad to attack Pakistan in the afternoon sessions.
McCullum was caught by Tanvir Ahmed off Rehman when his lofted shot came off the toe end of his bat for 64 shortly after lunch and their momentum stalled as Pakistan bowled short of a length and set defensive fields to stymie the scoring rate.
The hosts lost two quick wickets just before tea when Kane Williamson nicked a Tanvir delivery to Akmal for 15 with the score on 166 and was immediately followed by Guptill for 73 when he was trapped in front by Rehman.
Pakistan had been bowled out for 376, a first-innings advantage of 20 runs, late on Monday. They hold a 1-0 lead in the two-match series and are seeking their first Test series victory since 2006.
Pakistan: Mohammad Hafeez, Taufeeq Umar, Azhar Ali, Younis Khan, Misbah-ul-Haq (capt), Asad Shafiq, Adnan Akmal (wk), Abdur Rehman, Umar Gul, Tanvir Ahmed, Wahab Riaz
New Zealand: MJ Guptill, BB McCullum, KS Williamson, LRPL Taylor, JD Ryder, RA Young (wk), JEC Franklin, DL Vettori (capt), TG Southee, BJ Arnel, CS Martin