Much like Thursday's opening round, Mickelson started out slowly before rallying over his final nine holes at the Ocean Course with five birdies. He began the second day with one birdie to three bogeys on his first nine.
Mickelson, who hasn't won a golf major in over a decade, led in the clubhouse for a few hours before Oosthuizen passed him. Oosthuizen eventually dropped into a tie with Mickelson after making his lone bogey on hole No. 18.
The 50-year-old Mickelson was attempting to become the first player 50 or older to hold a 36-hole lead at a major championship since Fred Couples, who was 50 when he led at the 2012 Masters. The oldest player to win a major was Julius Boros, who was 48 when he won the 1968 PGA Championship.
"I'm having a lot of fun," Mickelson said after the second round. "I'm playing well, and to be in contention heading into the weekend, I'm having a blast. I'm excited for the weekend."
Two-time PGA champion Brooks Koepka was a shot back of Mickelson and Oosthuizen at 4-under par, while last month's Masters winner Hideki Matsuyama was tied with Branden Grace and Christiaan Bezuidenhout for fourth at 3-under 141.
Canada's Corey Conners, who held the lead after the first round, was among the five-man group tied for seventh at 2-under par.