Ross Taylor hit a half-century in a welcome return to form to help New Zealand recover after Sarfraz Ahmed hit a fighting hundred for Pakistan in the second Test in Dubai on Thursday.
Taylor was 77 not out for his 23rd fifty to help his team recover from a shaky 79-4 to close the fourth day on 167-6, an overall lead of 177.
Mark Craig (0) was also unbeaten at the close as New Zealand seek a series-levelling win in the three-Test series on an intriguing final day.
Pakistan won the first Test by 248 runs in Abu Dhabi last week.
Sarfraz’s 112 led Pakistan’s fightback as they reached 393 in their first innings in reply to New Zealand’s 403, conceding a slender 10-run lead.
Pakistani spinners Zulfiqar Babar (3-60) and Yasir Shah (3-65) jolted New Zealand but Taylor stood firm.
Babar removed Brendon McCullum (45), Kane Williamson (11) and Jimmy Neesham (11) in another display of beguiling left-arm spin on a Dubai stadium pitch that is taking notable turn.
Shah dismissed Tom Latham (9), Corey Anderson (0) and BJ Watling (11).
McCullum hit six fours in his 62-ball knock and when on 39 became New Zealand’s second top Test run-scorer, overhauling Martin Crowe’s 5,444 runs in 77 Tests.
Stephen Fleming is top of the list with 7,172 runs in 111 Tests. McCullum now has 5,451 runs in 89 Tests.
Earlier, Pakistan owed their fightback to Sarfraz, who hit a brilliant 112 for his third hundred — all scored this year.
He was last man out in the second over after lunch from McCullum, hitting 16 fours in a 215-minute stay, his innings saving Pakistan after New Zealand looked set for a big lead.
Sarfraz added 81 runs for the tenth wicket with Rahat Ali (16 not out).
Sarfraz hit three fours in one Craig over and then two more off leg-spinner Ish Sodhi to get to within four runs of his hundred.
He then cut seamer Tim Southee towards deep point for his 15th boundary to reach three-figures off 153 balls, the first Pakistani wicketkeeper-batsman to score three hundreds in a year.
He ran a full circle in jubilation, raising his bat to warm applause from his team-mates in the dressing room.
Sarfraz said he was delighted to help his team.
“It’s nice to score a hundred,” he said. “If we can get their last four wickets early then we can chase down the target.”
Sarfraz, 28 not out overnight, anchored the batting after Pakistan resumed the day on 281-6.
Paceman Tim Southee (3-67) removed Shah in the third over of the day, caught behind for two and just two runs later Trent Boult (2-69) trapped Ehsan Adil leg-before for nought.
But Sarfraz added an invaluable 25 for the ninth wicket with Babar (five) and then frustrated the Kiwis.
The third and final Test begins in Sharjah on November 26.