The 33-year-old was unbeaten on 111 for his 15th hundred and first since May last year, guiding Pakistan to 224-3 at lunch on the third day, just 50 behind New Zealand s total of 274.
At the break, Asad Shafiq was unbeaten on 55, helping Azhar add 139 for an unbroken fourth wicket stand as Pakistan seek a big lead to force a series-clinching win.
The three-match series is tied at 1-1.
Azhar edged medium pacer Colin de Grandhomme through the slips for his ninth boundary to complete his first century after 18 barren innings.
Azhar, whose last hundred was against the West Indies in Dominica in May 2017, took 210 balls to reach the three-figure mark.
He has so far stuck 10 boundaries while Shafiq has seven in his 22nd half-century.
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 Sheikh Zayed Stadium pitch.
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.
Boult has figures of 2-54 while fellow paceman Tim Southee has taken 1-39.