Seamer Dhammika Prasad chipped in with three wickets as the tourists collapsed in 42.5 overs by tea after skipper Misbah-ul Haq elected to bat on a fresh, bouncy pitch at the P. Sara Oval.
Sri Lanka, looking for a series-levelling win after losing the first Test in Galle by 10 wickets, were 70 for one at stumps and well set to build a big first innings lead.
Kumar Sangakkara was unbeaten on 18 and Kaushal Silva was on 21 after Dimuth Karunaratne was caught behind for 28 while trying to slash a wide ball from seamer Junaid Khan.
Mohammad Hafeez top-scored with 42 as Pakistan lost eight wickets in the afternoon session after resuming at the lunch score of 70 for two.
Also Read
Prasad, who took the field despite having suffered a finger injury during net practice on Wednesday, struck with the first ball of his second over to make it five for one.
He forced Ahmed Shehzad to edge a rising ball to second slip where the 37-year-old Kumar Sangakkara dived to his right to pick up a low catch.
Younis Khan, making his 100th Test appearance, survived a confident leg-before appeal on zero, but was caught behind by Dinesh Chandimal off Prasad for six in the first over after lunch.
Kaushal began his wicket hunt by bowling Hafeez in his fourth over and, six deliveries later, trapped Asad Shafiq leg-before for two as the tourists slid from 74-2 to 95-5.