Braun, playing his 600th NHL game, tied the score 3-3 with 2:40 left in the third period off a rebound that had come off the end boards. It was his second goal of the season and first in 43 games.
Rakell scored a power-play goal with 4:55 left to give Anaheim a 3-2 lead.
Timo Meier scored his 28th goal of the season on a power play to tie the game 2-2 at 6:29 of the third period.
Joe Thornton took a slap shot from the left circle that squeezed through the left arm and body of Gibson, and Meier was in position to push the puck across the goal line.
Brent Burns assisted on the goal, giving him an NHL career-high 77 points and breaking his team record for points by a defenseman set in 2016-17.
"We were in it the whole game," Sharks forward Logan Couture said. "A few plays here or there, a few chances we could have scored on when we had the opportunity and it would have been a different story."
That was the only goal in five power-play opportunities for the Sharks.
"We took a few too many penalties in this game, but at the same time, most of the time, our PK units weren't giving them anything," Rakell said. "It feels good to beat them."
Anaheim had taken a 2-1 lead on a power-play goal by Adam Henrique at 2:41 of the third. Henrique redirected a centering pass from Troy Terry through Dell's pads.
"We need to do a better job of getting those second and third opportunities on the power play," Henrique said. "Tonight we did a better job of getting to the corners, winning second pucks back, and that's where we end up getting some more chances."
Rakell gave the Ducks a 1-0 lead at 7:58 of the first period.
Burns turned the puck over in the defensive zone and Ducks forward Ryan Getzlaf made a quick pass to Silfverberg coming down the right side. Silfverberg passed to a trailing Rakell, and he scored on a wrist shot from just above the right circle.
"It feels good when you get to score pretty early in the game," Rakell said. "After that we kept coming throughout the whole game. We created scoring chances and put pressure on them."
Kevin Labanc made it 1-1 at 2:29 of the second period.
San Jose defenseman Tim Heed trapped the puck inside the Anaheim blue line and passed to Marcus Sorensen in the middle. Sorensen passed to Marc-Edouard Vlasic, who skated along the wall before making a short pass to Labanc at the left face-off dot
"Close game going into the third," DeBoer said. "I didn't think we gave them very much. The chances they got they stuck in the net though."