The tourists added six runs to their overnight score of 209-9, all of them coming off the bat of Sarfraz Ahmed, who remained unbeaten on 78.
Last man Imran Khan was bowled by Tharindu Kaushal for zero as Sri Lanka gained a lead of 63 runs.
The series is tied at 1-1 after Pakistan won the first Test in Galle by 10 wickets and Sri Lanka took the second in Colombo by seven wickets.