Amla, 31, hit eight fours in his composed 130-ball knock and shared a 151-run stand for the third wicket with skipper AB de Villiers (75), helping the visitors to post a formidable 304-5 at the R. Premadasa Stadium.
Kumar Sangakkara responded with a fine 88 off just 84 balls but Sri Lanka were still bundled out for 229 off 40.3 overs.
The hosts appeared headed towards victory at one point. But paceman McLaren dismissed Lahiru Thirimanne and Sangakkara in the 38th over to trigger a collapse that saw Sri Lanka lose their last five wickets for just 13 runs.
Earlier, Sri Lanka's unorthodox spinner Ajantha Mendis took 3-61 including the prized scalp of star all-rounder Jacques Kallis for a duck to peg back South Africa.
More From This Section
The visitors got off to a steady start, putting on 58 before losing two batsmen in quick succession.
Opener Quinton de Kock was bowled by Angelo Mathews (1-30) for 27 which included a mighty six over the mid-wicket fence off spinner Sachithra Senanayake (1-49).
Just two balls later, Mendis trapped Kallis leg before wicket with his trademark carrom ball to reduce the Proteas to a shaky 60-2.