First innings centurion Jacques Kallis was batting on 18 and Ashwell Prince 11 as South Africa closed on 76 for three for a lead of 235.
Playing in only his fifth Test, his fourth against Pakistan, Harris took 5 for 73 -- his first five-wicket haul -- to help dismiss the home side for 291 at tea after South Africa's first innings score of 450.
Pakistan fought back through their spinners Abdul Rehman and Danish Kaneria, who took three wickets for two runs on a supportive pitch as South Africa lost their top three batsmen in quick succession.
Rehman dismissed skipper Graeme Smith (25) and Hashim Amla (0) and leg-spinner Kaneria got Herschelle Gibbs (18) to reduce the visitors to 43 for three at one stage.
Gibbs, reached 6000 runs in his 85th match when he scored his third run.
Three of Harris's victims in the second session were stumped by Boucher as he eclipsed the mark set by Australia's Ian Healy.
Boucher equalled Healy's record of 395 when he stumped skipper Shoaib Malik (73) and then set the record by stumping Umar Gul (12) seven overs later.
"I am very proud to have achieved this record. Specially to break the record of a great wicketkeeper," Boucher told reporters.
Harris started the Pakistan collapse by breaking an obdurate 84-runs seventh-wicket stand between Malik and his deputy Salman Butt, who made a painstaking 24 from 76 balls.
The two came together half an hour into the day when nightwatchman Abdul Rehman (9) was caught behind off Andre Nel to leave Pakistan 149 for six.
Left-handed Butt was trapped leg before by Harris with an armer playing across the line and five runs later, Malik had a rush of blood, playing a wild slog and beaten by the turn.
He was dismissed with his team 12 runs short of saving the follow-on
"It is a nice feeling doing well against players who play spin well," he said.
Tailenders Gul and Kaneria (26) teamed up to save the follow-on by taking the total to 259.
After Gul was dismissed, Kaneria and Mohammad Asif (10) put on 32 runs for the last wicket before Dale Steyn castled Asif with the second new ball.