Jiri Hudler scored late in regulation to start Calgary’s comeback and then got the deciding goal in the shootout to lift the Flames to 5-4 win over the Devils on Saturday night.

Trailing 4-2, Flames coach Bob Hartley aggressively pulled goaltender Karri Ramo with just under 4 minutes remaining in regulation. Hudler scored from the side of the net with 2:22 left, and Curtis Glencross’ second goal of the game tied it with 5 seconds to go.

In the shootout, both teams scored once in the first three shooters before Hudler sent a shot past Devils goalie Scott Clemmensen to put Calgary ahead. Ramo clinched the victory by stopping Travis Zajac.

Clemmensen made his first start of the season after Cory Schneider started each of New Jersey’s first 20 games. Clemmensen, a 37-year-old longtime backup, had 33 saves through overtime.

Josh Jooris also scored for Calgary, which finished 4-1 on a five-game homestand. Ramo finished with 25 saves.

Adam Henrique, Mike Cammalleri, Zajac and Tuomo Ruutu scored for New Jersey, which is 1-1-1 on a four-game trip that concludes Tuesday at Vancouver.

The Flames improved to 5-6-0 when trailing after two periods. The five victories lead the NHL and is one more than they had all of last season in such circumstances.

Calgary trailed 3-1 entering the third period and pulled with a goal on Jooris’ power-play goal at 2:26. It was the 24-year-old rookie’s fifth score of the season.

Nevertheless, Ruutu restored the Devils’ two-goal cushion about 8 minutes later. He sped into the Flames’ end and while Ramo got a piece of Ruutu’s original shot that rattled off the end boards, the puck came right back out in front and Ruutu calmly flipped the puck over the goalie, who was sprawled on the ice.

Henrique opened the scoring at 4:51 of the first period, scoring his sixth of the season on a pretty setup from Patrick Elias, who faked carrying the puck behind the net, instead sending a backwards pass to Henrique, who put a perfect shot inside the far goal post.

Cammalleri made it 2-0 with 6:14 to go in the first when he was left wide open and one-timed a pass from Jaromir Jagr past Ramo.

Calgary pulled to 2-1 a little past the midpoint of the second period when Glencross corralled a loose puck in the slot, spun and whipped a shot past Clemmensen.

Zajac gave the Devils a two-goal lead again with 8 seconds left in the second when Henrique’s shot hit the crossbar, hit Ramo in the leg and bounced out to Zajac, who buried his fourth of the season.