NZ 26-2 after Azhar, Shafiq lead Pakistan to 348
Both openers Jeet Raval and Tom Latham went to pavilion on 0 and 10 respectively. Shaheen Afridi and Yasir Shah took one wicket each.
Earlier, Pakistan were bowled out for 348 in its first innings. Azhar Ali hit 134 and Asad Shafiq made 104 and added 201 for the fourth wicket before New Zealand hit back with seven wickets for 62 runs.
But both fell within 18 runs of each other, Azhar mistiming a sweep off debutant Will Somerville while Shafiq was trapped leg-before by Ajaz Patel with the score at 304.
At the break, Babar Azam was unbeaten on 14 and skipper Sarfraz Ahmed was batting on one and Pakistan still have five wickets to further their lead and secure victory in a three-match series currently tied at 1-1.
Azhar edged medium pacer Colin de Grandhomme through the slips for his ninth boundary to complete his first century since he notched one against West Indies in Dominica in May 2017 and his first ever hundreed against New Zealand.
He took 210 balls to reach the three-figure mark, smashing 12 boundaries during his 297-ball knock
Shafiq completed the 12th hundred of his career with a sharp single off Somerville before falling leg-before to Patel off a straight delivery.
He hit 14 boundaries in his 259-ball innings.
Azhar and Shafiq frustrated New Zealand's search for early wickets as they took Pakistan to 224-3 at lunch.
New Zealand skipper Kane Williamson took the second new ball in the 81st over with Pakistan comfortably placed at 213-3, but nothing worked for the bowlers on a flat pitch at the Sheikh Zayed Stadium.
Resuming at 139-3, Azhar hit Trent Boult for a boundary off the first ball of the day and then smacked spinner Ajaz Patel for another to enter the eighties.