Set a stiff target of 458 for victory, the hosts rode on centuries from Faf du Plessis (134) and AB de Villiers (103), but failed to pull off victory, falling short by just eight runs.
- Scorecard
In a riveting match, which saw fortunes fluctuating from one team to the other till the very end, both 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.
India needed to take eight wickets on Day 5, but a stunning 205-run partnership between Du Plessis and De Villiers denied the visitors a 1-0 lead in the two-Test series.
Plessis's knock came off 309 balls, inclusive of 15 boundaries, while De Villiers faced 168 balls and hit 12 boundaries.
The highest successful run chase in Test cricket was achieved by the West Indies, who scored 418 for 7 to beat Australia at St John's in 2003.
South Africa looked in contention with 64 runs from the final 16 overs and six wickets in hand, when Ishant Sharma bowled De Villiers, and Mohamed Shami dismissed J P Duminy before Du Plessis was run-out in the 133rd over by Ajinkya Rahane.
"We showed a lot of mental strength not to fade away," said South Africa captain Graeme Smith in a television interview later.
"We played it beautifully until Faf got run-out, and after that you have to respect the decision of the guys in the middle. Chasing it down would have been incredible. It went down to the last hour, which was great for Test cricket.
"At the start of the day we wanted to make sure we went to Durban with a chance of winning the series."
For India, young Shami was the pick of the bowlers, claiming three wickets for 107 runs.
After dismissing Jacques Kallis for his 300th wicket in 89 Tests, Zaheer Khan (1-135) proved expensive on the final day of the Test, even as Sharma (1-91) toiled.
R Ashwin (0-83), the lone spinner, was unable to provide a breakthrough as the fifth day pitch hardly offered him any assistance.
The teams will now travel to Durban, where the second and final Test will be played from December 26 to 30.
Earlier, Zaheer claimed his 300th Test wicket in the morning session, scalping the impressive Kallis (34). The all-rounder was adjudged leg before wicket by Australian umpire Rod Tucker.
There was a big inside edge that should have saved the veteran South African. However, with no referral system available in this series due to the Indian board's refusal to use technology, Kallis was unable to challenge the decision.
The controversial manner of the dismissal, though, meant little to Zaheer, who became the fourth Indian bowler to claim 300 Test wickets, after Anil Kumble (619), Kapil Dev (434) and Harbhajan Singh (413).
Shami had earlier bowled Alviro Petersen (76) off an inside edge, as the opener failed to add to his overnight score.
South Africa resumed the fifth day on 138 for 2, with Graeme Smith (44) and Hashim Amla (4) being the batsmen to fall on Saturday.
They started the last session of the day needing another 127 runs for a historic win. India captain Mahendra Singh Dhoni gave part-timer Virat Kohli to bowl, interchanging 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, while Zaheer bled runs since the new ball was 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 partnership 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. In the first hour after tea 61 runs were scored and only 66 more were needed in the final hour, which had 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 needed to win.
But then two quick wickets dented South Africa's push for the victory.
De Villiers was bowled by Ishant, as he inside-edged the ball back on to his stumps, while Shami bowled Duminy (5) in the same fashion.
It was left to du Plessis to see the team through and he nearly pulled it off in the company of Vernon Philander (25 not out, 37 balls, 3 fours).
However, at the sight of victory, in the 133rd over, du Plessis was run-out by Rahane.
With 16 needed off 19 balls, Dale Steyn (6 not out) came out to bat, but South Africa chose to shut shop and played out the last three overs for a draw.
Image: Faf du Plessis (right) with AB de Villiers.
Photograph: Duif du Toit/Gallo Images/Getty Images