South Africa, chasing 161 to win, were 36 for two at the end of the second day, Kaneria taking two for two in 2.1 overs.
Earlier, Mark Boucher's fine unbeaten 40 propelled Proteas' first innings score to 183 after they slumped from 131/5 to 140/8
Meanwhile Pakistan, who were reeling on 121 for 7 in their second essay was rescued by Mohammad Sami (31) and Shahid Nazir (27), who steered their side to a healthy 186 on a two-paced strip.
Fast bowler Dale Steyn was the chief destroyer for SA, finishing with three for 47.
Pakistan Ist innings 157 and 186 Vs South Africa 183 and 36 for 2