Chasing 268 for victory in 46 overs, India were bowled out for 234 in 40.2 overs.
Centurion: Yusuf Pathan hit a blistering 68-ball century but could not stop South Africa from winning the series-deciding fifth and final one-day international against India at SuperSport Park on Sunday.
South Africa won by 33 runs according to the Duckworth/Lewis method, clinching a come-from-behind 3-2 series win thanks mainly to a century by Hashim Amla and four wickets by fast bowler Morne Morkel.
Opening batsman Amla made 116 not out as South Africa reached 250 for nine in a rain-interrupted innings.
Set to make 268 to win, India were headed for a heavy defeat when they slumped to 119 for eight with fast bowlers Morkel and Dale Steyn inflicting most of the damage.
But Pathan unleashed a ferocious assault on the South African bowlers during a ninth wicket stand of 100 with Zaheer Khan.
Pathan slammed eight sixes and eight fours as he made 105 before he top-edged another attempted big hit against Morkel and sent a catch spiraling to cover.
Khan got a reprieve when the stand was worth 20 when he top-edged a short ball from Morkel and was caught by wicketkeeper AB de Villiers.
But umpire Simon Taufel asked television umpire Shaun George to check whether Morkel had bowled a no-ball. George ruled that Morkel had overstepped by millimetres and Khan batted on.
As the ball flew to all parts of the ground, South African captain Graeme Smith called on Morkel and the fast bowler finally induced a false stroke.
Morkel finished with four for 52 as India were all out for 234.
Indian captain Mahendra Singh Dhoni admitted that South Africa deserved to win. "It has been a disappointing series for the batsmen. We have not really performed as a batting unit. To say we wanted to win the final game just because Yusuf scored a hundred was asking for too much," said Dhoni.
Looking ahead to next month's World Cup, Dhoni said the big lesson for India was that if they were able to keep wickets in hand they could chase down almost any target with a powerful hitter like Pathan in the side.
Smith said South Africa had finished the series strongly.
"We were 2-1 down and we played two good games."
He said South Africa had paced their innings well, despite a late collapse after a rain break, and had bowled "really aggressively".
South Africa's innings was interrupted when the hosts were strongly placed at 226 for three after 42 overs.
The rain caused a delay of more than an hour and the match was reduced to 46 overs a side.
South Africa lost six wickets for 24 runs in the remaining four overs of their innings, with a succession of batsmen falling to ill-judged strokes and two run-outs in a chase for quick runs.
Dhoni sent South Africa in, hoping to take advantage of expected early morning life in the pitch - and also to have the option of revising his team's strategy in the event of predicted rain interruptions.
Smith fell once again to left-arm opening bowler Khan - for the 11th time in international cricket - edging a catch to second slip in the third over.
But Amla played a calm innings, content_cn to play the supporting role in a second wicket stand of 97 with Morne van Wyk, who made 56 off 63 balls, then picking up the pace in a fourth wicket stand of 102 off 98 balls with JP Duminy (35).
There were only four boundaries as Amla reached his fifty off 72 balls, but he added another five fours as he needed just 41 more deliveries to reach the first century by a batsman of either side in the series.
India opted to play only two seam bowlers, bringing in leg-spinner Piyush Chawla in place of Ashish Nehra.
For the second match in a row, Dhoni used eight bowlers, mainly in short spells.
As in the fourth match in Port Elizabeth, left-arm spinner Yuvraj Singh was the most effective of the slow bowlers, taking two for 45 in eight overs - the longest unbroken spell by any of the players.
But when Yuvraj conceded nine runs off his eighth over Dhoni immediately took him out of the attack.