Bangladesh took a first innings lead of 78 runs before they were all out for 326 runs during the extended second session of the third day's play in Chittagong.
South Africa, who made 248 in the first innings, were 61-0 in their second knock when bad light forced an early stumps with 24.5 overs left to be bowled.
Openers Stiaan van Zyl was unbeaten on 33 and Dean Elgar on 28 not out. The tourists still trail by 17 runs.
Off-spinner Simon Harmer also claimed three wickets, including the key scalps of Das and Shakib, to give South Africa a lifeline in what is shaping into a close contest.
Also Read
Das made 50 off 102 balls with the help of seven boundaries and tail-ender Mohammad Shahid belted 25 off 19 balls to provide Bangladesh the edge.
Steyn had Mushfiqur Rahim leg-before for 28 in South Africa's only success of the morning session, but Shakib (47) and Das stood firm to defy the visiting bowlers.
Das drove Steyn to take Bangladesh past South Africa's first innings total and took a single off the next ball to help his team equal their highest score of 252 runs against the Proteas.
Bangladesh, who have lost their previous eight Tests against South Africa, most of them by an innings margin, had made an impressive start to the match by bowling out the Proteas cheaply on the opening day.
Mohammad Mahmudullah scored 67 and Tamim Iqbal added 57 in the rain-shortened second day to lay a strong foundation for the home side.