Azam compiled a well-made 103 from 131 deliveries, while Malik's 81 came off only 61 balls in Pakistan's total of 292-6, before pacemen Hasan Ali (3-36) and Rumman Raees (3-49) restricted Sri Lanka to 209-8 from their 50 overs.
The victory was a good response by Pakistan after losing the preceding two-match Test series 2-0, in their first ODI since winning the Champions Trophy in England four months ago.
Lahiru Thirimanne was the only Sri Lankan top-order batsman who played with any authority for his 53 as Pakistan took regular wickets to take a 1-0 lead in the five-match series.
Akila Dananjaya (50 not out) and Jeffrey Vandersay (25) delayed the result as they took Sri Lanka from 132-7 to 200-8 during their 68-run eighth-wicket stand but it was too little, too late.
Left-armer Raees broke a quick 30-run opening partnership as he removed Niroshan Dickwella (19) and Dinesh Chandimal in successive overs, while Mohammad Hafeez dismissed captain Upul Tharanga for 18.
Medium pacer Ali had two wickets off two balls as he dislodged Kusal Mendis and Milinda Siriwardana to leave Sri Lanka struggling at 67-5.
Raees returned for his second spell to trap Thirimanne leg before to end Sri Lanka's hopes of a successful chase.
Thirimanne hit three boundaries in his 74-ball stay.
Pakistan, sent into bat, owed their total to Azam and Malik, who added 139 for the fourth wicket.
Malik holed out in the 47th over after smashing five fours and two sixes.
Azam's hundred came off 128 balls in the next over with a single, but three runs later he miscued a drive off paceman Suranga Lakmal, who finished with 2-47 from his ten overs.
Azam, who hit only five boundaries, had managed a poor 38 runs in the preceding 2-0 Test-series defeat but batted with guts to prove his credentials as a limited-overs batsman.
Pakistan plundered 89 in the last ten overs.
The nominal hosts got off to a poor start when opener Ahmed Shehzad fell for a 12-ball duck, caught off Lahiru Gamage in the fourth over of the innings.
Fakhar Zaman and Azam took the total to 75 before Akila Dananjaya bowled the opener with a googly.
The left-handed Zaman played well during his 45-ball 42 though, hitting four fours and a six.
The remaining matches will be played in Abu Dhabi (October 16 and 18) and Sharjah (October 20 and 23).
First Published: October 14, 2017, 1:13 AM IST