Tendulkar top-scored with 93 as India, chasing 227 for victory, finished on 227 for four with five balls to spare, and so levelled the three-match series at 1-1.
But India, after a top-order collapse, needed an unbroken fifth-wicket stand of 85 between Yuraj Singh, who'd earlier taken three for 36 with his part-time left spin, and Dinesh Karthik to see them home.
Yuvraj was 49 not out and Karthik 32 not out.
South Africa's total of 226 for six featured a career-best 82 from opener Morne van Wyk, which revived the Proteas after they'd collapsed to seven for two having been sent into bat on a seaming pitch, and a run-a-ball 55 not out from wicket-keeper Mark Boucher.
India, cruising to victory at 134 without loss, then lost four wickets for eight runs in 28 balls.
Their reply began with a blizzard of boundaries from Tendulkar.
The 'Little Master' hooked Makhaya Ntini for four and when Charl Langeveldt dropped short and wide outside off-stump, Tendulkar square cut him for four.
Ntini, not learning his lesson, was pulled for two more commanding fours and when Andre Nel, South Africa's quickest bowler, dropped short, Tendulkar pulled him for six to go to 49.
Tendulkar, who'd needed exactly 50 runs to reach the 15,000 mark when he began his innings, completed his half-century with a single off Nel which became a five after four overthrows. Tendulkar's 79th fifty at this level, in his 387th match, had come in 64 balls with one six and nine fours.
And with Ganguly going well, Tendulkar was in far more dominating form than he had been while making 99 in South Africa's four-wicket win in Tuesday's series opener.
Off-spinner Thandi Tshabalala, in only his second one-day international, felt the full force of Tendulkar's bat when driven for a textbook six and four off successive balls.
But then came the collapse.
Ganguly was caught by Herschelle Gibbs off Langeveldt at backward point off for 42 and India captain Rahul Dravid was caught and bowled by Langeveldt.
Man-of-the-match Tendulkar once more fell in sight of a hundred when he bottom-edged an intended cut off Tshabalala onto his stumps. He'd faced 106 balls with two sixes and 13 fours.
That left Tendulkar, 34, with a record of 15,043 one-day international runs at an average of 44.24 with 41 hundreds.
To make matters worse for India, dangerman Mahendra Singh Dhoni was bowled between bat and pad for nought by Ntini.
But Yuvraj, on one when Karthik came in, kept his head.
South Africa captain Jacques Kallis, a pace bowling all-rounder, didn't bring himself on until six overs were left.
Yuvraj reduced the target with a superb hoisted six off Andrew Hall over deep backward square leg.
He then late cut Langeveldt for four to leave India requiring just one off the final over, bowled by Kallis with Karthik scoring the clinching single.
Yuvraj faced 63 balls with one six and four fours.
The series concludes at Stormont on Sunday.