Sri Lanka hit back with three Pakistan wickets in the final session, including the scalp of century-maker Younus Khan, to boost their chances of drawing the series by the close on the third day of the third and final Test in neutral Sharjah.
With two days remaining, Pakistan are 282 for six and trail Sri Lanka by 131 runs with four first-innings wickets in hand.
The first Test in Abu Dhabi ended in a draw. Sri Lanka lost the second Test by nine wickets in Dubai to go 1-0 down in the series.
The "home" matches for Pakistan are being played in the Gulf region due to security concerns.