Miller plundered a robust 85 not out off 72 balls to steer South Africa to 223-7 after unorthodox spinner Ajantha Mendis had reduced the tourists to 154-7 in the 42nd over.
Tsotsobe then ripped through Sri Lanka’s top order with three wickets in the space of six runs before finishing with 4-22 as the hosts were bundled out for 167 in the day-night game.
The victory ended South Africa’s 11-match losing streak in one-day cricket on Sri Lankan soil and gave AB de Villiers' tourists a badly-needed win in the current series.
Spotted: Virat Kohli, Anushka Sharma and other celebs at Mumbai airport
Photos: Salman Khan's 'special friend' Iulia Vantur at a song launch
Photos: Hrithik Roshan, Anushka Sharma, other celebs dazzle at event
In Pictures: Sex scandals involving Indian politicians
Photos: Abhishek Bachchan and Farah Khan at Boman Irani's birthday bash