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.
|No fears over Atleti´s second-place finish for Simeone|
|Clippers buckled under Raptors pressure - Rivers|
|Icardi: Inter deserved to qualify|
|Team Sky future unclear as Sky opt to end involvement in cycling|
|PSG had to change mentality - Thiago Silva|
|Rockets make change, pick up win over Trail Blazers|
|Everything´s easier when you´ve got Messi – Miranda|
|From George Cross to Arsenal – Montemurro´s rise to make Gunners great again|
|Koulibaly challenges Napoli to win Europa League|
|Raptors star Leonard out against Clippers, may miss matchup with Warriors|
|Butler opens up about heated Timberwolves practice|
|Spurs achieved ´mission impossible´, says Pochettino|
|Dembele stunner pleases Barca boss Valverde|
|Van Dijk lauds ´fantastic´ Alisson|
|Van Dijk´s tackle on Mertens worthy of red card – Ancelotti|
|Klopp ´would have paid double´ for Alisson|
|Klopp: I don´t care about Madrid revenge mission|
|Tension and anxiety got to Inter, laments Spalletti|
|Tuchel hails magnificent PSG as Red Star win seals last-16 spot|
|Mbappe admits frank discussions inspired PSG´s Champions League progress|
|Klopp: Napoli had no answers to outstanding Liverpool|
|Pochettino proud of ´massive, massive achievement´ for Spurs|
|Barcelona equal Champions League record|
|Composed and controlled Liverpool see off Napoli to progress|
|Tenerife back to winning ways, AEK beat Hapoel|
|Howedes ´hurt´ after emotional Schalke return ends in defeat|
|Kane ´buzzing´ over ´not bad´ draw at Barcelona|
|Robertson hails Alisson´s ´unbelievable´ save as Liverpool progress|
|Red Star Belgrade 1 Paris Saint-Germain 4: Neymar brilliance helps secure Group C top spot|
|Inter 1 PSV 1: Icardi header not enough for the Nerazzurri|
|Liverpool 1 Napoli 0: Superb Salah sends Reds through|
|Club Brugge 0 Atletico Madrid 0: Simeone´s men miss out on top spot|
|Barcelona 1 Tottenham 1: Lucas rescues Spurs late on to secure progress|
|Monaco 0 Borussia Dortmund 2: Guerreiro double snatches top spot from Atletico|
|Butler´s groin strain ´nothing significant´ – 76ers coach Brown|
|Woakes, Curran among leading lights at IPL auction|
|Blue Jays release five-time All-Star Tulowitzki|
|Mourinho: Professionals care more than the fans|
|Casillas reaches 100 Champions League wins|
|Expansion franchise Cincinnati sign Garza, send Kamara to Rapids|
|Manchester City sign United States goalkeeper Steffen for reported £7m|
|Schalke 1 Lokomotiv Moscow 0: Russians miss chance for Europa League reprieve|
|Galatasaray 2 Porto 3: Terim´s men into Europa League after penalty drama|
|Jackman leaves Dragons role|
|Tottenham boosted as Barcelona bench Messi|
|Mane and Henderson in Liverpool XI to face Napoli|
|Mourinho shoots down question over how to get the best from Pogba|
|Ronaldo to start as Allegri aims to avoid Champions League big guns|
|Odriozola: I´m in love with Benzema, he´s the best number nine in the world|
|Vikings fire OC DeFilippo after loss to Seahawks|
|Marcelino suggests Valencia open to Batshuayi departure|
|Bottas to make rally debut in title-winning M-Sport Ford Fiesta|
|Kovac dismisses Pavard speculation|
|Yaya Toure leaves Olympiacos after just five appearances|
|Riise challenges Liverpool to banish Champions League disappointment against Napoli|
|We rallied around it - Durant on Green confrontation aftermath|
|Valencia ´p****d off´ with Fellaini´s controversial Young Boys winner - Soler|
|More must be done to combat racism at Premier League grounds – Chalobah|
|Napoli will not sack ´big signing´ Ancelotti if they miss Champions League qualification, says De La|
|Guardiola not interested in ´exceptional´ Saul|
|Shai gives Windies hope with thrilling ODI run chase|
|Ten Hag unsure whether to risk Ajax stars against Bayern|
|Erasmus to work with Bulls as Springboks assist Super Rugby sides|
|Paul Gascoigne pleads not guilty to sexual assault|
|Joshua is ´begging´ for unification fight, claims Wilder|
|Silva, Fernandinho add to Guardiola´s injury woes|
|Hosszu storms to 14th gold, Seto smashes Le Clos´ world record|
|Raheem is an incredible human being - Guardiola rallies behind City star Sterling|
|Sexton pens IRFU extension until 2021|
|Ajax boss Ten Hag can do big things, says Bayern chief Rummenigge|