Celebrini one-timed a shot past Jakub Dobes from the right face-off circle on a pass from Ivar Stenberg.
Celebrini also had an assist, and Michael Misa and Tyler Toffoli scored for the Sharks (5-4-1), who had lost their past two games, including 3-1 at the Toronto Maple Leafs on Monday. Alex Nedeljkovic made 31 saves.
Cole Caufield, Juraj Slafkovsky and Nick Suzuki each had a goal and an assist for the Canadiens (4-3-2), who had won three of their past four games. Jakub Dobes made 26 saves.
Misa cut Montreal’s lead to 3-2 at 5:36 of the third period when he got behind defenseman Noah Dobson as he drove to the net and buried a feed from Kiefer Sherwood.
Toffoli’s power-play goal at 11:09 tied it 3-3. He was in the slot to one-time Celebrini’s one-touch pass from the right circle.
Celebrini scored at 13:49 of the first period to put San Jose ahead 1-0. Will Smith’s forecheck caused Montreal forward Jake Evans’ pass attempt to float into the top of the slot, where Celebrini pounced on the loose puck and skated in alone before flipping a shot over Dobes’ right arm.
Suzuki tied it 1-1 at 16:38 with a shot from the right circle past Nedeljkovic’s glove on a pass from Slafkovsky.
Slafkovsky put the Canadiens up 2-1 at 1:25 of the second with a highlight-reel goal. He flipped the puck past Sharks defenseman Darnell Nurse and recovered it before cutting across the goalmouth to tuck it around Nedeljkovic.
Caufield made it 3-1 at 14:03 when he snapped a shot past Nedeljkovic on Suzuki’s feed from behind the net.