At the break, opener Kaushal Silva was on a defiant 40 not out and with him Mahela Jayawardene unbeaten on 19 having added 44 for the unbroken fourth wicket stand. (Agencies)
They lost Kumar Sangakkara (26) and Dinesh Chandimal (12) in the space of 13 runs. Sri Lanka now trail by 33 runs over Pakistan's first innings total of 165.
Silva, who hit a fighting 81 in the first Test in Abu Dhabi, has so far hit four boundaries during his solid 107-ball stay, while Jayawardene looked determined to strike form after twin failures in the first Test.
The first of the three Tests was drawn last week.
Resuming at 57-1, Sri Lanka had hoped experienced batsman Sangakkara would score more but the left-hander fell in the sixth over of the day.
Left-arm paceman Rahat Ali, who went wicketless in the first Test, trapped Sangakkara leg before with a ball that kept straight and missed the forward push.
Junaid, who had figures of 2-36, then had Chandimal caught at deep fine-leg off an uppish hook shot.
Off-spinner Saeed Ajmal, also wicketless in the second innings of the first Test, once again toiled hard, having so far failed to make an impact.
Pakistan wasted one referral when they appealed for a caught behind against Silva but the replays showed Ali's delivery did not touch the bat and Indian umpire Sundaram Ravi's decision was upheld.
At the break, opener Kaushal Silva was on a defiant 40 not out and with him Mahela Jayawardene unbeaten on 19 having added 44 for the unbroken fourth wicket stand.