The prolific wicket-taker took 2-25 as Sri Lanka struggled to 69-4, needing a rearguard action to save the Test.
Pakistan will be expecting to push for victory in the opening match of a two-Test series on the fifth and final day.
It was tough to negotiate spin on a fourth-day Sheikh Zayed Stadium pitch, but despite a 32nd Test five-wicket haul for veteran Sri Lankan spinner Rangana Herath, Pakistan posted 422 to take a slender three-run lead.
At the close, Kusal Mendis was batting on 16, with nightwatchman Suranga Lakmal on two, after a day of fluctuating fortunes.
Herath's 5-93 in 40 overs were well foiled by a brilliant 76 by Test debutant Haris Sohail, as initially it looked as though Sri Lanka would take a first-innings lead.
Pakistan then hit back in the second innings through Shah, who first had opener Dimuth Karunaratne caught for 10 and then dismissed first-innings centurion Chandimal, caught at slip, for seven.
Sohail followed his responsible knock by claiming Kaushal Silva's wicket, whom he trapped leg before for 25, while part-timer Asad Shafiq had Lahiru Thirimanne for seven.
The 39-year-old left-arm spinner, who now has 394 wickets in 84 Tests, gave his team the much-needed wicket of a resolute Azhar Ali, luring him into an uppish drive which was brilliantly caught at short mid-wicket by a diving Mendis.
Azhar's defiant knock of 85 lasted more than five hours and included four boundaries, but with his dismissal Pakistan's hopes of building a lead looked slim.
But Sohail had other ideas as he added an invaluable 50 for the ninth wicket with tail-ender Hasan Ali to lift Pakistan from 340-8.
Hasan's whirlwind 25-ball 29 featured three sixes and two fours.
The second and final Test -- a day-night affair -- will be played in Dubai from October 6.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
