The visitors were initially bowled out for 202 runs on Day 1. With the absence of Virat Kohli, India had a batting collapse with only KL Rahul and Ravichandran Ashwin registering noteworthy knocks.
Opener Rahul smashed 50 off 133 deliveries and Ashwin played a gritty knock of 46 runs in 50 balls.
Marco Jansen was in hot form for the hosts, taking four wickets.
In response, South Africa posted 229 runs in their first innings, taking a lead of 27 runs.
Keegan Petersen's 62-run knock proved to be crucial for the Proteas and even Temba Bavuma registered a half-century.
After his five-wicket haul, Thakur went on to take two more wickets and finished with figures of 7/61.
The visitors will be aiming to reduce the deficit and put in a good start to their second innings.