Garcia's 1-under 71 moved him to 9 under 135 overall, but his four-shot advantage from the first day disappeared as Oosthuizen (67) made an eagle and five birdies at Gary Player Country Club.
While Garcia bogeyed three of his last six holes, Oosthuizen came home in 32, with that eagle and two birdies on his back nine.
Garcia is seeking a third Nedbank title but first since 2003. Oosthuizen, who is from South Africa, has never won his country's most prestigious tournament.
Mikko Korhonen (70) was third at 6 under, two behind Oosthuizen and three off the lead.
Rory McIlroy, who is still in the running to win the Race to Dubai and end the season as European No. 1, is tied for 19th after a 71. McIlroy must win at least one of the final two events of the season, the Nedbank and next weekend's DP World Tour Championship, to have a chance of overhauling Race to Dubai leader Francesco Molinari, who isn't playing in Sun City.
Li Haotong and Lucas Bjerregaard also have outside chances at the Race to Dubai title but Haotong was six shots off the lead at the Nedbank Challenge and Bjerregaard was 10 behind.
Garcia couldn't match his blistering opening-round 64 and ended with a bogey when his short par putt looped all the way around the hole and came back out. But he was still solid overall on a course with lightning-fast greens and a series of pins tucked away in the corners.
"Not every day you're going to go out there and shoot 64," Garcia said. "It doesn't work like that. I feel like I played quite well."
Oosthuizen's second round gave the 2010 British Open champion the chance of a first tournament win since February 2016.
His 67 was matched by Dylan Frittelli, one of four players tied for fourth. Also in that group is Lee Westwood (69), a two-time winner at Sun City.
Ross Fisher came close to the round of the day when he made the turn in 31 after three birdies and an eagle in his first nine. He was 8 under after 14 holes.
But Fisher had a series of mishaps on No. 15. First, the Englishman sent his tee shot way left and the ball was trapped under a dead tree, which he would have been allowed to move if he had been able to lift it. He couldn't and had to take a drop. He then found trees again and lost his ball. He was on the green in six and three-putted for a nine on the par 4.
Fisher then bogeyed his last three holes, dropping eight shots in his last four for a 72 when he was on course to better Garcia's opening-round 64.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies