Pakistan reached tea on 12 without loss in their second innings, a deficit of 92 runs.
South Africa were dismissed for 417 in reply to Pakistan's first innings of 313. Prince scored 138, while fast bowler Asif, playing his first match for his country since he and Shoaib Akhtar tested positive for the banned steroid nandrolone in November, took five for 89.
Prince, who took guard when South Africa's third wicket fell six overs after lunch on Friday, was finally removed with what became the last ball before lunch on Saturday when leg-spinner Danish Kaneria had him stumped by wicketkeeper Kamran Akmal.
The left-handed Prince advanced down the pitch to Kaneria and failed to make contact. Akmal gathered cleanly but missed with his first swipe at the stumps.
Prince scrambled back towards safety, but Akmal removed the bails just in time to send the South African packing.
The patient, diligent Prince batted for almost six hours in which he faced 214 balls and hit 19 fours.
His dismissal ended a dominating fifth-wicket stand of 213 that he shared with Herschelle Gibbs.
Prince's demise also began a slide in which five wickets tumbled for 35 runs. Among them was Gibbs, who was seventh out for 94 when he was trapped in front by fast bowler Naved-ul-Hasan.
South Africa's chances of building a significant lead seemed to be on the wane, but Shaun Pollock scored a brisk unbeaten 39 off 58 balls with five fours and a six to extend the home side's advantage to 104 runs.
Asif completed his five-wicket haul when he had Makhaya Ntini caught by Younis Khan at second slip for five to end the innings.
Mohammad Hafeez was nine not out at tea with Imran Farhat on three.
Pakistan 313 and 12/0 Vs South Africa (Ashwell Prince 138, Herschelle Gibbs 94, Amla 71, Pollock 39 n o; Mohd Asif 5 for 89, Danish Kaneria 3 for 97, Naved Rana 2 for 92)