Spinners share nine wickets between them to bowl Pakistan out for 261.
Final-day thriller on the cards after Dhananjaya de Silva ton sets Pakistan mammoth target.
Pakistan first innings ended on 231, with the hosts taking a 147-run lead.
Eleven wickets fell on day two in Galle, with Pakistan trailing by 187 runs.
Dickwella, along with Wellalage, would see through the remainder of the day, as Sri Lanka headed to stumps at 315/6.
The opener finished the game at an unbeaten 160 runs.
Pakistan lost the wicket of Babar at the fag end of the day.
Dinesh Chandimal (86*) helped Sri Lanka push their lead to 333 at the end of day three despite a brilliant five-wicket haul from Mohammad Nawaz.
The hosts ended the day 40 runs in front with nine wickets still in hand
Sri Lanka fought back well, adding 89 runs for the last two wickets and then removing the Pakistan openers cheaply