Set a very reachable target of 130 runs for victory after winning the toss and sending Sri Lanka into bat, the hosts would end up three runs short of the target after a thrilling final over that saw the visitors come out on top.
Skipper Chamari Athapaththu top-scored for Sri Lanka with a well-played half-century (68 off 50 balls) as Sri Lanka posted 129-4. She shared what would turn out to be a match-winning 86-run partnership with Vishmi Gunaratne (35).
South Africa will feel they should have gotten the runs required, but kept losing wickets at crucial times, which prevented them from setting any lasting partnerships.
While they ultimately batted out their 20 overs, they were nine wickets down at the end, with the tailenders unable to steer the side home, despite managing to get a boundary off the final ball.
Skipper Sune Luus top-scored with 28, clear evidence of how the players struggled to maintain their wickets after getting to the crease.
Inoka Ranaweera proved to be the hero for Sri Lanka, taking three wickets for just 18 runs, and claiming the valuable scalps of Laura Wolvaardt (18), Marizanne Kapp (11) and Sune Luus.
Sugandika Kumari and Oshadi Ranasinghe also picked up two wickets each to keep the South Africans under the cosh.
South Africa will now need to win all of their remaining Group A matches if they hope to progress past the pool stages.
They will be back in action on Monday when they meet New Zealand at Boland Park.