Kumar Sangakkara topscored for the hosts with a 35-ball 39 and Thisara Perera was unbeaten on 22 as Sri Lanka lost wickets at regular intervals to finish well short of the target.
Both the teams return to the same ground for the final Twenty20 international on Tuesday.
Opting to bat first, South Africa slumped to 48 for three inside nine overs before JP Duminy (30) and AB de Villiers (15) added 38 runs in 4.4 overs.
It was, however, David Miller's 21-ball 36 that powered them to a challenging total which their bowlers defended with aplomb.
Lonwabo Tsotsobe (2-17) wrecked Sri Lanka's top order while Morne Morkel (2-34) took the important wicket of Sangakkara to derail Sri Lanka's chase.
(Reporting by Amlan Chakraborty in New Delhi, editing by Pritha Sarkar)
