On the third day of the first Test in Karachi on Thursday, the South African batsmen thwarted Pakistan’s spin attack until they reached 84-1 over tea.
Earlier, Pakistan scored 378 to take a 158-run lead over South Africa’s first innings total of 220.
At break, Eden Markram was on 34 and Rossi van der Dawson was on 17.
The visitors need 74 more runs to avoid an innings defeat.
Markram, who was bowled out for 27 by Pakistan captain Babar Azam at the hands of off-spinner Yasir Shah, added 36 for the second wicket with Dosan.
Markram and Dan Elgar started the confidence from South Africa and they scored 37 runs against Pakistan’s attack.
Elgar was in pain after he was hit by the left hand of fast bowler Shaheen Shah Afridi’s increasing delivery, giving Yasir 29 runs and was caught by diving wicketkeeper Mohammad Rizwan.
Early in the morning, Pakistan’s tail disappointed South Africa by adding 70 runs, who were looking for fast wickets.
South African fast bowler Kagisu Rabada bowled Hassan Ali for 21 to take 200 wickets in the 44th Test.
Rabada, 25, is the eighth South African to take 200 or more Test wickets.
At that time Pakistan was 323-9 but Yasir and Noman Ali added 55 valuable runs for the last wicket.
Yasir, who scored a Test century in Australia in 2019, hit a six and four fours in 38 not out, while debutant Noman hit three boundaries before making 24 runs.
Rabada 3-70 and spinner Cashew Maharaj, who took 3-90, were the South African bowlers of choice.
On Wednesday, Fawad Alam led Pakistan’s recovery against South Africa after scoring a Test century at home.
Fawad reached his third ton in Test cricket, hitting sixes off left-arm spinner Kishwa Maharaj.
The two-match Test series is South Africa’s first in Pakistan in 14 years. The second Test will be played in Rawalpindi from February 4.
The hosts have won just one of their previous seven Tests against Pakistan in South Africa, with visitors claiming two wins with four draws.