Pakistan will chase 274 runs for victory on day five of the second cricket test in Wellington on Wednesday after New Zealand were bowled out for 293 in their second innings.
New Zealand had looked on track to score an even bigger total, with Brendon McCullum and top-scorer Martin Guptill firing at the top of the order with a century opening stand on Tuesday.
But a late collapse left Pakistan in with a chance of chasing down their score at the Basin Reserve.
Pakistan's tight bowling slowed the scoring after McCullum went for 64 soon after lunch and Guptill followed for 73.
Although rain was forecast all day, only 25 minutes was lost late in the afternoon. But when play resumed, Jesse Ryder (17) and James Franklin (6) fell cheaply to offspinner Mohammed Hafeez.
Ross Taylor and Reece Young added 60 for the sixth wicket, before Young went for 20 and Taylor followed on 52.
Umar Gul then ripped through the lower order, with New Zealand losing four wickets for just seven runs at the end of the late session.
Captain Dan Vettori was bowled for 1, before Gul trapped Brent Arnel lbw for a duck in the next delivery.
Chris Martin (1) became his fourth wicket, leaving Tim Southee on 22 which included two sixes.
McCullum says the test is now perfectly poised.
"I think it's set up for what could be a great day of test cricket to finish off a test match - 270 was probably what we were looking at in a day anyway, regardless of whether we were bowled out or not. It was probably around the score we wanted."
The fifth day of the test gets underway at 11am on Wednesday, though more rain is forecast.