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.
Shaheen Afridi and Yasir Shah remove New Zealand openers Jeet Raval and Tom Latham before stumps in Abu Dhabi, the visitors trail Pakistan by 48 runs on 26/2 in their second innings.— ICC (@ICC) December 5, 2018
What was your highlight of day three?#PAKvNZ scorecard https://t.co/cS8PI6iRJl pic.twitter.com/UKD1rDJPo9
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.
|BREAKING NEWS: Kroos agrees Real Madrid extension to 2023|
|Gundogan to renew contract talks with Manchester City|
|Folau opts not to appeal against Rugby Australia ban, still considering options|
|Nadal clear French Open favourite – Djokovic|
|Nedved: No Juve decision amid Sarri and Inzaghi links|
|Gil Marin: We need players totally committed to Atletico|
|Gardner´s big game helps Yankees pull away from Rays|
|This is playoff basketball – Leonard on playing through injury in Raptors win|
|Second most NRL games and 99 tries – Cronk´s career in Opta numbers|
|Spieth: I´m almost back at my best|
|Three takeaways from Raptors´ key Game 3 win over Bucks|
|Trail Blazers star Lillard addresses rib injury|
|Raptors top Bucks in double-OT thriller|
|MLS Review: Nani brace lifts Orlando, Galaxy stunned by Rapids|
|Cronk: It´s been one hell of a ride|
|Johnson upbeat despite falling short|
|Koepka holds on at US PGA – how a dramatic back nine unfolded at Bethpage Black|
|´Phenomenal´ and ´mind-blowing´ – Koepka basks in US PGA triumph|
|NRL great Cronk to retire at season´s end|
|Kevin Muscat to leave Melbourne Victory|
|Bethpage wobble does little to deny Koepka´s status as golf´s dominant major force|
|Brooks Koepka´s timeline of major dominance following US PGA triumph|
|Koepka relieved to retain US PGA title after ´stressful´ finish|
|Allegri seeking a challenge, not a sabbatical|
|Koepka retains PGA title despite back-nine collapse|
|Spalletti tells players to prove they´ve the bottle to play for Inter|
|City want to dominate English football forever, says Laporte|
|Fernando Alonso fails to quality for Indy 500|
|Bordeaux collapse to costly defeat, Stade hopes dashed by Montpellier|
|Valverde pessimistic about Coutinho, Dembele playing in Copa final|
|Koepka collapse sets up grandstand finale at PGA|
|Everyone would want our situation - De Bruyne not concerned by Champions League failure|
|Mbappe drops PSG exit hint|
|Guardiola: I´ll be judged on Champions League record at Man City|
|Gattuso thankful to Milan penalty hero Donnarumma|
|Johnson cuts Koepka lead to four with nine to play at Bethpage|
|Arthur ´very confident´ in Pakistan CWC hopes despite losing streak|
|Juventus 1 Atalanta 1: Mandzukic spares Allegri from defeat in home finale|
|Napoli 4 Inter 1: Spalletti´s side crushed as Champions League race goes to the wire|
|Woakes: World Cup wait makes for nervy Monday|
|Koepka retains control of PGA after early wobble|
|Tsonga topples Lajovic in Lyon|
|Galatasaray edge derby to retain Super Lig title|
|Sabalenka ends clay drought in style with Strasbourg success|
|Here´s to you, Vincent Kompany – The giant of Manchester City´s changing times|
|Wonderful Woakes stars as England wrap up 4-0 win|
|AC Milan 2 Frosinone 0: Piatek and Suso keep top-four hopes intact|
|Messi equals Zarra´s record with sixth Pichichi award|
|Ireland outclass Afghanistan in Belfast|
|Ligue 1 sensation Pepe to leave Lille|
|Paderborn clinch promotion back to the Bundesliga|
|Five player-manager success stories for Kompany to follow|
|Nadal breaks 2019 duck by downing Djokovic for ninth Rome crown|
|Roglic pounces on Campenaerts´ misfortune to apply pressure to Giro leader Conti|
|Eibar 2 Barcelona 2: Two-goal Messi moves four clear of Mbappe in Golden Shoe race|
|Dominant Koepka chasing history in final round of US PGA|
|Betis confirm Setien departure|
|Celtic´s Boyata agrees to join Hertha Berlin|
|´I have lived the dream´: Kompany´s best moments at Manchester City|
|Zidane vows to make changes as Navas & Bale face uncertain futures|
|MotoGP Raceweek: Marquez masters Le Mans to make it three wins in four|
|We are the guilty ones - Marcelo says Madrid players must accept responsibility|
|Ten trophies, 360 appearances, 20 goals - Kompany´s Manchester City career in numbers|
|Pliskova seals Rome title with straight-sets win|
|De Bruyne, Neville and a rock ´n´ roll star pay tribute to captain fantastic Kompany|
|Perth Glory 0 Sydney FC 0 (aet, 1-4 on penalties): Redmayne the hero in A-League Grand Final|
|Real Madrid 0 Real Betis 2: Zidane´s men humbled in final-day defeat|
|Joshua-Wilder must be next, no excuses - Hearn|
|Trail Blazers need effort over strategy in Game 4 against Warriors - Stotts|
|Fans to receive 82 per cent of Euro 2020 tickets|