The 22-year-old, playing in his fourth Test after being called up as cover for his sick Somerset team-mate Jack Leach, finished the day with five for 51.
Wicketkeeper-batsman Mushfiqur Rahim was left out after saying he would not go to Pakistan for security reasons.
India dominated Friday's second match and won by 36 runs, with opener Shikhar Dhawan hitting 96 and KL Rahul smashing 80 off 52 balls.
The series will now be decided in Bangalore on Sunday.
England declared on 499 for nine and South Africa were struggling on 60 for two when rain brought an early close to the day.
Shikhar Dhawan made 96, KL Rahul 80 and captain Virat Kohli 78 as the Indian batsmen dominated the Australian bowlers.
The 38-year-old was Thursday recalled to Pakistan's Twenty20 series against Bangladesh starting in Lahore from January 24.
The South Africa fast bowler pleaded guilty to a level one breach of the ICC code of conduct because of the way he celebrated the dismissal of England captain Joe Root.
Bangladesh are scheduled to play three Twenty20 internationals, two Tests and one one-day international in Pakistan between January and April.
England were 224 for four at the end of an attritional day during which South Africa had briefly claimed the advantage.
Dhoni has not appeared for club or country since the World Cup in July and the wicketkeeper-batsman has been expected to announce his retirement for some time.
The squad announced by chief selector and head coach Misbah-ul-Haq is a total revamp to the team which lost 3-0 to Sri Lanka in October last year, and then 2-0 to Australia in November.
It was only Ireland's second victory in T20 cricket over the West Indies who went into the game having swept the ODI series 3-0.
Batting star De Villiers, who retired from international cricket in 2018, was quoted on an Australian website on Tuesday as saying he was keen to return.
England captain Joe Root added: "It's hard to say any more superlatives. It's the right decision, obviously. It couldn't really be anyone else the way he’s performed all year, across the formats.