Set a stiff target of 458 for victory, the hosts rode on centuries from Faf du Plessis (134) and AB de Villiers (103) to very nearly pull off a sensational victory but in the end fell short by just eight runs.
In a riveting match, which saw fortunes fluctuating from one team to the other till the very end, both teams had chances of winning the game in the nerve-wrecking final session on a Wanderers track, which showed no signs of deterioration even on the final day.
Indian needed to take eight wickets today but a stunning 205-run partnership between Du Plessis and De Villiers denied the visitors a 1-0 lead in the two-Test series.
South Africa sniffed a historic win on the back of their fifth-wicket partnership as they inched closer to the improbable target of 458 runs, which if achieved would have been the biggest ever successful run chase in Test history.
The highest successful run chase in Test cricket has been achieved by West Indies who scored 418 for seven to beat Australia in St Johns in 2003.
At one stage, it looked like the Proteas would romp home as they needed just 64 runs from the final 16 overs with six wickets in hand but Ishant Sharma bowled De Villiers and Mohamed Shami dismissed JP Duminy before Du Plessis' run out in 133rd over.
It prompted South Africans to not take further risk and go for a draw.
Plessis's knock came off 309 balls with 15 boundaries while De Villiers faced 168 balls and hit 12 boundaries.
It was a remarkable Test match and the Indians would feel that they let go a good opportunity to record a famous Test win on foreign soil particularly after the drubbing in the preceding ODI series.
The two teams will now travel to Durban, where the second and final Test will begin from Thursday.
For India, Shami (3/107) was the pick of the bowlers. After dismissing Jacques Kallis for his 300th wicket in 89 Tests, Zaheer Khan (1/135) proved expensive on the final day of the match, even as Sharma (1/91) toiled hard.
R Ashwin (0/83), the lone spinner, did not provide any breakthroughs as the fifth day pitch evened out for batting.
South Africa started the last session of the day needing another 127 runs for a historic win. MS Dhoni gave a bowl to Kohli, interchanging the ends for Zaheer and Ishant who he deployed first up.
It was a surprise move since Shami had not bowled since the 88th over of the innings, whilst Zaheer had bled runs since the new ball had been taken in the 80th over.
The 150-run partnership came in the 111th over then, along with the 350-run mark. Two overs later, du Plessis celebrated his third Test hundred.
When his pairing with de Villiers breached the 178-run mark, it became the highest fifth wicket partnership in the fourth innings of a Test match.
The previous best was 177 by B Congdon and V Pollard for New Zealand against England at Nottingham in 1973. 61 runs had come in the first hour after tea and only 66 more runs were needed in the final hour spanning 15 overs.
De Villiers completed his 18th Test hundred in the 121st over and in the next, the 200-run partnership came up. The 400-run mark was up too, with 58 runs to win.
Finally Shami was back in the 123rd over, after an inexplicable gap of 34 overs. It showed immediately as he mad the batsmen skip with awkward bounce on incoming deliveries.
Maybe it helped as de Villiers was bowled in the next over by Ishant, bringing an end to his partnership with du Plessis. At the other end, Shami bowled JP Duminy (5).
It was left to du Plessis to see this through and he nearly did, in the company of Vernon Philander (25 not out, 37 balls, 3 fours). But at the sight of victory, in the 133rd over, du Plessis was run-out via a direct hit from mid-off by Ajinkya Rahane.
With 16 needed off 19 balls, Dale Steyn (6 not out) came out to bat. But Zaheer and Shami bowled fierce spells to keep the run-scoring in check. Philander also shut up, as did Steyn, although he did hit a six off the last ball.
Earlier, the Proteas scored 95 runs in the second session without losing a wicket, setting a great platform to chase down this target. Starting at 236 for 4, India deployed the new ball straightaway in the 80th over.
Zaheer and Shami were into the attack, and they toiled hard. If 'leaving the ball well' described the Indian batsmen in this match, then 'playing with soft hands' is an apt phrase to describe the South African batsmen.
They went soft at the hard, new ball with many a streaky edges flowing past the two-slip cordon and towards the boundary. Even when there was awkward bounce, the slips never came into play, as the pacers started bleedings runs.
Sharma too toiled hard, but with the sun out, he didn't get as much bite from the wicket as in the first innings.
Shami was the best bowler on display, but even he failed to get a breakthrough. Du Plessis┐ fifty came in the 82nd over, wherein he was also hit on his right thumb, but soldiered on nevertheless. De Villiers celebrated his half-century in the 88th over.
India needed a bit of luck to go their way, and Ajinkya Rahane had a shy at the stumps in the 102nd over, and du Plessis would have been out if he had hit. But he didn't, underlining the second session India had endured.
In the morning session, South Africa began the day at their overnight score of 138/2, with Alviro Petersen (76 not out) and du Plessis (10 not out) on strike.
Peterson was bowled in the 50th over, fifth of the day, as an incoming delivery from Shami kept low and he got an inside edge onto his stumps. He was out for 76, without adding a run to his overnight score. In all, he faced 162 balls and hitting nine fours.
Kallis scored 31 runs off just 29 balls, hitting six fours, bringing a quick-fire 50-partnership with du Plessis.
He seemed to be in a hurry chasing down a huge score and looked set, when umpire Rod Tucker wrongly adjudged him LBW off Zaheer in the 61st over. He was out for 34 runs off 37
balls, as a huge inside edge rocked his front pads.
But the umpire's finger went up and he became Zaheer's 300th Test victim in his 89th Test. The left-arm veteran speedster is the fourth highest wicket-taker for India in Test cricket, after Anil Kumble (619 wickets in 132 Tests), Kapil Dev (434 wickets in 131 Tests) and Harbhajan Singh (413 wickets in 101 Tests).