Lakmal dismissed openers Stephen Cook and Dean Elgar in quick succession after their 104-run partnership gave the hosts a strong start.
JP Duminy's aggressive 63 steadied the innings before he was trapped lbw by left-arm spinner Rangana Herath.
Lakmal then struck with the new ball as he had Faf du Plessis caught at slip.
Sri Lanka are searching for their first Test victory in South Africa since December 2011, where they won by 208 runs.
Sri Lanka pace bowler Suranga Lakmal took four wickets to restrict South Africa to 267-6 on the first day in Port Elizabeth.