Pandya's 93 and 2/17 gave India a much-needed impetus despite the Proteas leading by 142 run at the end of Day Two.
Pandya struck a spirited innings before India were bundled out for 209 to close their first-innings gap to 77 runs.
Having lost Murali Vijay (1), Shikhar Dhawan (16) and skipper Virat Kohli (5) cheaply on Day One, India relied heavily on their swashbuckling batsmen Rohit Sharma and Cheteshwar Pujara after they took the team past 50-run mark.
But, Rohit and Pujara failed to convert their good start into big innings and were dismissed lowly for 11 and 26 respectively.
However, Pandya came from behind and served as the lone survivour for India by notching up a blistering 93-run knock as the visitors staged a late fight back in the match.
The main highlight of India's innings was Pandya's 99-run stand with Bhuvneshwar Kumar, after which the latter dismissed for 25.
For South Africa, Vernon Philander was the pick of the bowlers for his remarkable figures of three for 33 followed by Kagiso Rabada's three for 34.
Morne Morkel and Dale Steyn grabbed two wickets each.
Pandya struck with the ball twice, getting rid of Aiden Markram and Dean Elgar, as soon as the Proteas got to batting.
At stumps on day 2, South Africa are leading with 142, as their second innings total reads 65/2. (ANI)