Abu Dhabi, December 5: Azhar Ali and Asad Shafiq both hit centuries to give Pakistan a first-innings lead before New Zealand's bowlers fought back in the deciding third Test in Abu Dhabi.
Pakistan began the third day three wickets down and still 135 runs in arrears but were only 50 behind at lunch, with Azhar having brought up his 15th Test hundred in the morning.
They had taken a lead by the time he was removed for 134 and, though Shafiq (104) reached three figures too, debutant Will Somerville led a New Zealand recovery as Pakistan went from 286-3 to 348 all out.
New Zealand then lost both of their openers in the 14 overs before stumps and finished on 26-2, with Pakistan 48 runs ahead.
Pakistan encountered few difficulties in a morning session where they put on 85 runs and Azhar benefitted from no slip to reach his century with a loose shot.
His fourth-wicket alliance with Shafiq was worth 201 when Somerville claimed his first Test victim as Azhar's sweep was directed straight to Ajaz Patel at short fine leg.
Shafiq, who had narrowly avoided driving to gully on 73, had two further scary moments on 99 as a miscue fell short of midwicket and a big swipe hit his foot, but he eventually scampered through for a single to reach the landmark.
He had added just four more when he was trapped lbw by Patel as Pakistan lost their final six wickets for just 44 runs.
Babar Azam saw a delivery from Somerville come off his bat and hit both off his feet before rolling back onto the stumps, while Ross Taylor took a smart catch at slip off Patel's bowling to send Bilal Asif back.
Yasir Shah was run out at the non-strikers' end having stumbled and lost his shoe before Somerville, who finished with 4-75, accounted for Hasan Ali and Sarfraz Ahmed to restrict the Black Caps' lead to 74.
Pakistan made an early breakthrough in New Zealand's innings as Shaheen Afridi pinned the scoreless Jeet Raval in front in the fourth over.
And they were two down before the close of play as Tom Latham gave Yasir his 199th Test wicket with a top edge to Haris Sohail at deep square leg.