Rehman dismissed Kumar Sangakkara (eight) and opener Kaushal Silva (36) in an incisive spell on a Sharjah stadium pitch which still does not offer sharp spin, against all expectations.
At the break, Mahela Jayawardene (23) and Dinesh Chandimal (13) were at the crease with Sri Lanka enjoying an overall lead of 175 runs with seven wickets intact.
Pakistan have one full session and a day to play for a series-levelling win and need quick wickets.
It was Rehman who struck a telling blow by dismissing experienced Sangakkara, caught sweeping at deep square-leg to make inroads into the Sri Lankan batting.
Rehman then bowled a resolute Silva to leave Sri Lanka at 66-3.
