Centuries by Azhar Ali and Asad Shafiq helped Pakistan overhaul New Zealand's total of 274 but a lower-order collapse saw their lead restricted to 74 on day three of the third and final Test in Abu Dhabi on Wednesday.
Sarfraz Ahmed's side nevertheless regained control of the match by picking up two quick New Zealand wickets to leave them in trouble at 26-2 in 14 overs at close of play.
Kiwi skipper Kane Williamson, who scored a fighting 89 in the first innings, was batting on 14 with nightwatchman William Somerville for company on one with the visitors trailing by 48.
Pakistan, who resumed on their overnight score of 139-3, rode on Azhar's 134 and Shafiq's 104 to get into a commanding position in the series decider at the Sheikh Zayed Stadium.
The pair's 201-run partnership for the fourth wicket ended when Azhar became off-spinner Somerville's first Test victim.
The 33-year-old batsman mistimed a sweep to offer Ajaz Patel a catch at short fine leg and leave Pakistan at 286-4.
Shafiq perished shortly afterwards after failing to read left-armer Patel's arm ball and was adjudged leg before with a review confirming the dismissal.
His wicket triggered a Pakistan collapse as they went from 304-5 to 348 all out with Somerville ripping up the tail after tea to finish with figures of 4-75.
New Zealand could not capitalise as opener Jeet Raval was dismissed for a duck by left-arm paceman Shaheen Shah Afridi before leg-spinner Yasir Shah sent back Tom Latham for 10.
Shah, who has four wickets in the match, needs one more to replace Australian Clarrie Grimmett as the fastest man to claim 200 test victims. Leg-spinner Grimmett reached the 200 mark in his 36th Test back in 1936. Shah is on 199 in just his 33rd Test match.
New Zealand won the opening test in Abu Dhabi by four runs before Pakistan squared the three-match series with victory in the second Test in Dubai by an innings and 16 runs.