Nico Hischier had a goal and an assist, and Ondrej Palat had two assists for the Devils (29-12-3), who have won five straight overall and seven straight on the road. Vitek Vanecek made 29 saves, and Tomas Tatar scored the only goal in the shootout.
"It was an awful way to win, but that's what good teams do," Tatar said. "Obviously, we had to overcome the fatigue. It's the third game in four nights, and we didn't get much rest."
Erik Karlsson and Timo Meier each had a goal and an assist, and Michael Eyssimont had two assists for the Sharks (13-23-9), who are 2-6-2 in their past 10 games. James Reimer made 38 saves.
"A loss is a loss and it's not something to be happy about," Eyssimont said. "Whether you lose in a shootout or regulation, it's tough to get in your car and stomach it. It [stinks]. But tonight I think we can look at ourselves and say that we did some good things and we played hard."
Hughes made it 3-3 when his shot from high in the left face-off circle redirected off Karlsson's stick in front.
"That one feels good, especially after we slept in the first but battled back, and at the end, I still feel we deserved it," said Hischier, the Devils captain.