The hosts, who had raced to 85 for one by lunch after being sent in to bat, suffered a top order collapse engineered by Yasir and went to tea on a shaky 153-4.
Opener Dimuth Karunaratne held the innings together with an unbeaten 70, his second consecutive half-century in the series. Jehan Mubarak was on nine.
Pakistan, winning the toss for the third time in a row, secured an early break with the wicket of Kaushal Silva, who had scored 125 in the first Test in Galle and 80 in the second in Colombo.
Pakistan had won the first Test by 10 wickets and Sri Lanka responded with a seven-wicket victory in the second match.
More From This Section
The left-handed pair of Karunaratne and Upul Tharanga put on 91 for the second wicket on either side of lunch to lift the score to 106 for one, before three wickets fell for 31 runs.
Tharanga, who replaced Kumar Sangakkara for the match, made 46 when he edged Yasir to slip where an alert Younis Khan took a smart catch diving in front.
The wicket of the Sri Lankan captain was Yasir's 20th in the series, enabling Pakistan to come back strongly despite conditions favouring the batsmen on the evenly-paced pitch.
Both sides reshuffled their packs with four changes each in a bid to break the 1-1 series deadlock.
Besides the three seamers who came in, Pakistan also brought in left-hand batsman Shan Masood.
Two of those changes were forced as pace spearhead Wahab Riaz was sidelined with a fractured hand, and Mohammad Hafeez was not available since he has to be tested after being reported for a suspect action in the first Test.
The hosts also left out veteran left-arm spinner Rangana Herath and injured fast bowler Dushmantha Chameera to play seamers Suranga Lakmal and Nuwan Pradeep. Dhammika Prasad leads the three-man pace attack.