The 22-year-old debutant removed Sangakkara (55) with the last ball of his tenth over and then had Jayawardene off the first of his next to leave Sri Lanka at 186-4 in their second innings at close on the third day on a Sheikh Zayed Stadium pitch which had eased out for batsmen.
Junaid (2-46) built on the strikes by dismissing Kaushal Silva for 81, caught behind in the last over of the day.
Dinesh Chandimal was the unbeaten batsman at close with 24 as Sri Lanka, who conceded a 179-run lead in the first innings, are now seven runs ahead with six wickets in hand.
Earlier, Pakistan were dismissed for 383 runs in their first innings in reply to Sri Lanka's 204.
More From This Section
Silva's dismissal has given Pakistan a sniff of victory on fourth day. He hit 11 boundaries during his 275-minute stay and gave Sri Lanka a confident start of 47 with Dimuth Karunaratne (24).
The experienced Sangakkara, who hit an epic double hundred to draw a Test at the same venue against Pakistan in 2011, brought up his 43rd Test fifty with a crisp cut shot off Bhatti for his sixth boundary.
It was Bhatti (2-65) who seeemed to have got Sangakkara on 29 when a sharp delivery trapped the left-hander leg before and English umpire Richard Kettleborough upheld the appeal but the intelligent batsman challenged the decision.
But Bhatti had the last laugh as he forced an edge off Sangakkara which was snapped up in the slips by Younis Khan.