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 their 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 put Calgary ahead 3-2 at 13:28 of the third period, scoring with a shot past Georgiev's blocker from the low slot during a 4-on-4. It was his first goal this season and his first game-winning goal in the NHL.
"It felt unreal," said Hanley, who has four goals in 221 NHL games. "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."