Alexander Wennberg had two assists, and Yaroslav Askarov made 38 saves for the Sharks (19-17-3), who have won two in a row.
Troy Terry had two goals and an assist, Cutter Gauthier had a goal and an assist, and Pavel Mintyukov also scored for the Ducks (21-16-2), who have lost three in a row to match their longest skid of the season.
"I don't know if lazy is the word, but we hadn't been skating as much as we were at the beginning of the season, so I thought we were doing that tonight, creating a lot of chances," Terry said. "That's just the way it goes sometimes. We can't feel sorry for ourselves, we've got to get this thing going again."
Lukas Dostal allowed four goals on nine shots before being replaced in the second period by Petr Mrazek, who made three saves in relief.
Wennberg spun away from Anaheim defenseman Drew Helleson along the wall and centered a puck to Mario Ferraro, who had beaten Mikael Granlund down the ice. Ferraro redirected the puck into the net for his 100th NHL point and a 1-0 lead at 10:43 of the first period.
Askarov was indecisive with the puck behind his net, and Ducks forward Nikita Nesterenko stole it from him before getting it out front to Terry, who slid the puck into an open net to tie it 1-1 at 15:02.
"It felt like, especially when we tied it, it felt like we were in control of that game and dictating the pace," Terry said.
Celebrini put San Jose back up 2-1 at 19:12. Wennberg floated a saucer pass to Celebrini in the slot, where he beat Dostal with a snap shot short side.
Igor Chernyshov, who scored his first NHL goal in a 6-3 win at the Vancouver Canucks on Saturday, scored again when he received a pass in front of the Anaheim net after a turnover. He pulled the puck to his backhand before scoring from in close to stretch the lead to 3-1 at 6:30 of the second period.
"You can call them grade-A," Anaheim coach Joel Quenneville said of the San Jose scoring chances off turnovers. "I think we needed one or two of those prevented."