You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Azhar, who finished the day unbeaten on 62 off 169 balls, helped Pakistan recover from the loss of two early wickets to trail New Zealand by 135 runs with seven wickets remaining.
Asad Shafiq was unbeaten on 26 after the pair shared an unbroken fourth-wicket partnership of 54 at the Sheikh Zayed Stadium.
New Zealand pace bowler Trent Boult had removed the out-of-form Mohammad Hafeez and Imam-ul-Haq with only 17 runs on the board, having both openers caught by Tim Southee in the slips.
With Pakistan facing a familiar top-order collapse, Azhar stitched together a 68-run stand with Haris Sohail (34) to ease their nerves.
A well-set Sohail was dismissed when he edged Southee to wicketkeeper BJ Watling, but Azhar and Shafiq dropped anchor to ensure Pakistan did not suffer any more losses.
Earlier, New Zealand added 45 runs to their overnight score of 229-7, with Watling finishing unbeaten on 77.
Off-spinner Bilal Asif, who picked up two wickets on Monday, completed his second five-wicket haul in tests.
Debutant William Somerville was bowled for his overnight score of 12 after he failed to read Asif's sharp turn and the same bowler had Ajaz Patel caught at slip and bowled Boult to finish with figures of 5-65.
New Zealand won the opening test in Abu Dhabi by four runs before Pakistan levelled the three-match series with victory in the second test in Dubai by an innings and 16 runs.