Dubai, United Arab Emirates: New Zealand lost the key wicket of Tom Latham to reach 54-1 at tea on the fourth day of the second test after Sarfraz Ahmed led Pakistan's strong fightback with his third century of the year on Thursday.
Captain Brendon McCullum was unbeaten on 41 but Latham was caught in the leg slip for just nine as New Zealand stretched its overall lead to 64.
Latham, who scored a century in New Zealand's first-innings score of 403, immediately called for a television referral claiming the ball had caught his forearm before it was caught by Asad Shafiq.
However, TV umpire Rod Tucker upheld the onfield umpire's decision as Latham walked back while shaking his head in disappointment.
Earlier, Ahmed led Pakistan's recovery with a gallant 112 off 195 balls, hitting 16 fours before Pakistan was bowled out for 393 and conceded a 10-run lead.
Resuming at 281-6, Tim Southee's (3-67) twin strikes had Pakistan reeling at 312-9 before Ahmed put on 81 runs with Rahat Ali (16 not out) to raise Pakistan's best 10th-wicket stand to the frustration of the Kiwis.
McCullum finally ended the agony when he caught and bowled Ahmed in the second over after lunch to get his first test wicket.
Ahmed and Ali improved the previous best 10th-wicket partnership of 65 against New Zealand made by Salahuddin Ahmed and Mohammad Farooq at Rawalpindi way back in 1965.
Ahmed raced to his century by hitting spinners Mark Craig and Ish Sodhi for three boundaries each in back-to-back overs before cutting Southee to the point boundary to complete his century off 153 balls.
Ali also frustrated McCullum's bid to take an extra half an hour before lunch to wrap up the innings by twice lofting Sodhi over his head for boundaries.
Southee had raised New Zealand hopes of a sizeable lead when he found the outside edge of overnight batsman Shah and then trapped Ehsan Adil lbw in successive overs with some lively pace bowling.
Trent Boult then had Zulfiqar Babar caught behind with Pakistan still trailing by 91 runs before Ahmed found a useful ally in Ali.
Ahmed was on 53 when Ali joined him but didn't panic. He mostly kept the strike to himself and exposed Ali for the last two deliveries during their gritty 28 overs of resistance.
Ahmed also became the first Pakistan wicketkeeper to have scored three test centuries in a calendar year after making 109 against Australia last month and 103 against Sri Lanka in August.
Pakistan leads the three-match series 1-0 after an emphatic 248-run victory in the first test at Abu Dhabi last week.