Pakistan need 88 runs to win the first Test after South Africa were dismissed for 245 in their second innings on the fourth day in Karachi on Friday.
Left-arm spinner Nauman Ali took 5-35 for the hosts while Yasir Shah finished with 4-79.
Temba Bavuma was the last man out for 40.
Earlier, the Proteas had resumed their second innings on 187 for 4, holding a lead of 29 runs.
The second Test starts on February 4 in Rawalpindi.
For more news your way, download The Citizen’s app for iOS and Android.