Fresh from a workman-like first innings century despite defeat in the second Test, Ali was again a model of composure in progressing towards another significant innings after over five hours at the crease during which he faced 219 deliveries, stroking two sixes and seven fours.
His confidence dented after enduring the indignity of a "pair" in that loss in Barbados, Azam was less assured at the start of his innings and needed a generous slice of luck to get to his second half-century of the series.
That lapse added to the increasing list of costly errors in the field for the West Indies during this 2017 international season in the Caribbean as the pair extended their second-wicket partnership to 120 when Azam eventually departed in a long final session, offering a simple catch to Kieran Powell at first slip off Alzarri Joseph.
Younis Khan, who together with captain Misbah ul Haq is playing his farewell Test, will resume in partnership with Ali on the second morning, weather permitting.
More From This Section
Sharing the new ball with Gabriel, Joseph was completely out of sorts in his first spell, prompting the introduction of Roston Chase's off-spin within the first hour's play.
That resulted in the visitors' only casualty of the morning. Shan Masood, playing his first match of the series in place of the unwell Ahmed Shehzad, reached nine off 30 deliveries and prodded indecisively at a delivery from Chase for Holder to take the straightforward catch at second slip.
Pakistan have never won a Test series in the Caribbean on seven previous tours while the West Indies are seeking a first Test series triumph in five years against a team ranked higher than themselves.