Pakistan batted sensibly on the fourth morning of the first test on Wednesday before declaring their second innings at 181-6 to set Australia a huge victory target of 462 in Dubai.
Imam was the first to fall on the day, offering left-arm spinner Jon Holland an easy return catch.
He was soon joined in the dressing room by Sohail, who was adjudged leg before off the bowling of debutant Marnus Labuschagne after Australia sought a review of the umpire's original decision.
Off-spinner Nathan Lyon tempted Shafiq into playing a lofty shot which was held by Mitchell Marsh at deep mid-wicket with the batsman falling on 41.
Abu Dhabi will host the second and final test from Oct. 16.
(With inputs from agencies.)