The tourists, who resumed on 311-4, went to lunch on the final day on 392-6 in their second innings, still 195 runs away from avoiding an innings defeat.
Mark Boucher was unbeaten at the break on 80 and Nicky Boje was on 18, the pair having added 42 runs for the unbroken seventh wicket here on Monday.
Muralitharan dismissed South African captain Ashwell Prince in the second over of the day and removed Herschelle Gibbs at the stroke of the drinks break.
The wily off-spinner had Prince caught low at slip by Sri Lankan captain Mahela Jayawardene, ending a defiant fifth-wicket stand of 78 with Boucher.
Left-handed Prince added only one run to his overnight score of 60.
Gibbs, who was forced to bat at number seven after being off the field on the third day with a virus, plodded for 32 balls to make 18 until he drove a full toss back to Muralitharan.
Boucher, 38 overnight, continued to defy the Sri Lankans and moved within 20 runs of his fifth Test century. He has so far hit nine boundaries.
English umpire Mark Benson sat out the morning session due to a stomach bug and Asoka de Silva of Sri Lanka, the third umpire, took the field with Billy Bowden of New Zealand.