Skipper Tim Southee dismissed opener Abdullah Shafique with the second ball of Pakistan's second innings before Ish Sodhi bowled nightwatchman Mir Hamza in the last over of the fourth day.
Pakistan started disastrously by losing two wickets without scoring Thursday after New Zealand set them a bold target of 319 to win the second Test in Karachi.
Skipper Tim Southee dismissed opener Abdullah Shafique with the second ball of Pakistan's second innings before Ish Sodhi bowled nightwatchman Mir Hamza in the last over of the fourth day.
At the close, a shocked Imam-ul-Haq was at the crease without scoring and the home team needing 319 runs for victory, or eight wickets in hand to hold out for a draw.
A loss would be their third series defeat at home in a season after going down 1-0 to Australia and 3-0 to England earlier this year.
No team has chased more than 314 to win a Test in Pakistan, which the home team set against Australia in Karachi 1994.
New Zealand declared their second innings ten minutes before close on 277-5 after Michael Bracewell hit a career-best 74 not out and Tom Blundell 74.
The pair turned the match during their match-turning 127-run fifth wicket stand.
Pakistan had the match under control when they had New Zealand struggling at 128-4 from 76-1 at lunch, removing Tom Latham (62), Kane Williamson (41) and Henry Nicholls (five).
But Blundell, dropped on 21 by wicketkeeper Sarfaraz Ahmed off spinner Abrar Ahmed, punished the home team with seven boundaries and a six before holing out off Agha Salman.
Bracewell, whose previous best of 49 was against England earlier this year, was also dropped on 59 by Sarfaraz off Salman.
In the post-lunch session New Zealand lost three wickets in the space of 50 balls and 14 runs.
Latham was smartly caught off a miscued flick at short mid-wicket by Abrar Ahmed from fast-bowler Naseem Shah.
With the total unmoved on 114, in the next over Ahmed trapped Williamson leg-before. Hasan Ali had Nicholls caught soon after as New Zealand lost three wickets off 50 balls for 14 runs.
Field umpires Alex Wharf and Aleem Dar had a horrible day with three of their decisions overturned.
New Zealand were jolted in the second over of their innings when Mir Hamza bowled Conway with his first delivery.
It was the first time Conway fell without scoring in his 12-match Test career.
Pakistan wasted two leg-before referrals on Williamson when the batter was on seven and nine, while Latham overturned a decision against him on 36 -- all off Ahmed.
At the start of the day, Pakistan were dismissed for 408 after adding just one run to their overnight score, in response to New Zealand's 449 first-innings total.
Spinner Ish Sodhi had last man Ahmed trapped leg-before for nought, leaving centurion Saud Shakeel stranded on the other end.
Shakeel was unbeaten on 125 after a marathon resistance-packed 493 minutes at the crease, hitting 17 boundaries in his maiden hundred.
Spinner Ajaz Patel finished with 3-88 and Sodhi 3-95.
The first of the two-match series -- also in Karachi -- ended in a draw.