Yasir Shah provided the first breakthrough of the day by dismissing Kane Williamson with a beauty of a legbreak.
Hasan Ali struck twice in an over to account for an attacking Ross Taylor and a well-set Jeet Rawal with reverse swing.
BJ Watling and Henry Nicholls put on a frustrating 112-run stand for the fifth wicket, and made Pakistan endure a wicketless afternoon session.
Yasir Shah produced the breakthrough again, when he got Henry Nicholls to under-edge a sweep to the keeper for a stunning low catch. He went on to pick four wickets in three overs and dismantled New Zealand's fightback.
Ish Sodhi made a quick-fire 18 to puff New Zealand's second innings score.
Both Yasir Shah and Hasan Ali picked five-wicket hauls to restrict Pakistan's target to 176. In response. Imam-ul-Haq scored briskly, and Pakistan need 139 more runs on Day 4 to win the Test.