Fabian Zetterlund scored for the Sharks (19-54-9). Devin Cooley allowed five goals on 23 shots before being replaced midway through the game by Georgi Romanov, who made 14 saves.
"A game is a full 60 minutes," Zetterlund. "I don't remember the last time we played a full 60. We learn from it. Everyone's going to get home now and get better during the offseason and come back stronger."
San Jose has missed the playoffs in five straight seasons.
"It's tough to reflect on it right now with everything that just happened and how it went, but obviously we need to take steps to get better," " Sharks defenseman @kyle burrou said. "That's something we want to do, that's something we want to provide, and we'll look to do that.
"It's just tough to end like that. It's just not the way we wanted to go out."
Klapka scored his first NHL goal in his sixth game to give the Flames a 1-0 lead at 12:13 of the first period. He shot top corner over Cooley's right shoulder from the slot.
"It's amazing, especially here in the Saddledome in Calgary," Klapka said. "It's amazing. I'll never forget about it."
Coleman pushed it to 2-0 at 14:40, a backdoor tap-in on a Connor Zary pass on the power play.
"We all care about each other, and we want to see each other succeed," said Coleman, the first Texas-born player to reach 30 goals in NHL history. "I think at the end of the day that's what you're most proud of here down the stretch is guys are playing for each other. This could've been a throwaway, meaningless game and guys took it upon themselves to find something to care about, and it was each other."
Kylington made it 3-0 at 3:53 of the second period with a wrist shot through a screen, and Rooney extended the lead to 4-0 at 5:59 with a shot from the slot over Cooley's right shoulder.
Weegar beat Cooley over the glove with a shot from the point for a 5-0 lead at 6:56. Cooley was replaced by Romanov after the goal.
Weegar, who set a Flames defenseman record with 17 even-strength goals, is the first defenseman to have 20 goals and 200 blocked shots since the NHL started recording blocked shots in 2004-05.
"That was pretty special," Weegar said. "It's one of those things that you look at at the end of your career and you can just enjoy a beer and enjoy that record but in the meantime I'm here for business. I want this team to go in the right direction. I'm looking forward to talking about next year, for sure."