South Africa were 356 for five at lunch on Saturday, 43 ahead of Pakistan's first innings total of 313.
Prince was out in the last over before lunch when he was stumped by Kamran Akmal off Danish Kaneria for 138. Gibbs was unbeaten on 88. The fifth wicket partnership between the pair was worth 213.
The left-handed Prince, who has made all his Test hundreds within the space of two years, batted fluently but survived a close lbw appeal by Mohammad Asif on 98 and an appeal for caught and bowled by Shahid Nazir when he had 126.
In the latter incident, Prince mistimed a drive and Nazir picked up the ball low down in his follow through.
Nazir threw the ball up in triumph but Prince stood his ground. Umpire Steve Bucknor consulted with square leg umpire Billy Doctrove and the appeal was referred to television umpire Karl Hurter.
The replays were inconclusive although it seemed Nazir might have caught the ball on the half-volley and Prince was given not out.
Pakistan's bowlers were largely lacklustre on a hot, cloudless day. South African batsman Hashim Amla said Friday his team wanted to bat only once but they had to survive a danger period five overs into Saturday's play when Pakistan took the second new ball.
Mohammad Asif, who took all four wickets Friday, gaining prodigious swing, was unable to recover the form he showed with the first new ball, while fellow seamers Nazir and Rana Naved-ul-Hasan seldom threatened the batsmen.
Prince's innings was ended when he went down the pitch and missed a ball from leg-spinner Kaneria. With an easy stumping chance, Akmal missed with his first pass at the stumps before knocking off the bails at the second attempt.
Prince almost got back but was given out on a television replay decision. He batted for 347 minutes, faced 213 balls and hit 19 fours.
It was reported that leading Pakistan batsman Mohammad Yousuf, who missed the first Test because his wife was having a baby, would be in South Africa in time for the remaining two Tests following the birth of a daughter Friday.
Pakistan Ist innings 313 Vs South Africa 356 for 5 ( Ashwell Prince 138, Amla 71, Herschelle Gibbs 88 n o; Mohd Asif 4 for 78, Danish Kaneria 1 for 67)