Joel Hanley and Kevin Rooney scored for the Flames (27-21-8), who had lost three straight and four of five. Dustin Wolf made 27 saves.
"Found a way... found a way," Kadri said. "That was really what it was all about today. I don't think it was our best game at all. I think the execution was a little bit sloppy. But we found a way and dug in."
Tyler Toffoli had a goal and an assist, and Macklin Celebrini scored for the Sharks (15-36-7), who have lost five in a row and 11 of the past 12 games. Alexandar Georgiev made 33 saves.
"It (stinks)," Toffoli said. "If anyone says they're having a good time losing games then I don't want them on my team, to be honest. It's one of those things where we just have to keep working and keep trying to find a way to battle and we need to get some wins."
Hanley shot top corner by Georgiev's blocker from the low slot to put Calgary ahead 3-2 at 13:28 of the third period with both teams skating four aside. It was his first goal this season, first in 32 games dating back to March 23, 2024, and his first game-winning goal in the NHL.
"It felt unreal," said Hanley, who has four goals in 221 career games with the Flames, Dallas Stars, Arizona Coyotes and Montreal Canadiens. "It was great. Obviously I don't score a lot so whenever I can contribute offensively it feels really good. It was nice to get the win."