The victory not only ended a three-game losing streak but moved the Flames (33-24-4) into the second wild card into the Stanley Cup Playoffs from the Western Conference with 70 points, one ahead of the Minnesota Wild. The Winnipeg Jets, who have played one more game than the Flames, hold the first wild card with 73 points.
Curtis Glencross, Sean Monahan and TJ Brodie scored for the Flames. Ramo, who was coming off a 28-save, 1-0 loss against the New York Rangers on Tuesday, made eight saves in the third period. His best stop came against Tuomo Ruutu off a shot from the left hash at 11:17 with the Flames holding a 2-1 lead.
"They were points that we needed desperately and we were desperate enough to get the win," Ramo said. "I know I played on Tuesday but the coach asked me before the game if I felt good enough and I said 'OK.'
"My body felt good and mentally I was OK."
Ramo was asked if he was excited after his 10th win of the season.
"I'm just tired," he said.
Calgary will play the third of a season-high seven-game Eastern Conference road trip against the New York Islanders on Friday.
The Flames received a scare at the end of the game when captain Mark Giordano, who scored his 48th point on an assist, appeared to sustain an injury in the final seconds after getting tangled in the stick of Devils forward Steve Bernier.
Flames coach Bob Hartley said Giordano would be re-evaluated on Thursday. The defenseman was walking and moving in the locker room at the end of the game.
Ramo made a few big saves during a frenetic final minute when Flames forward Mikael Backlund was called for delay of game with 47 seconds remaining and Devils goalie Cory Schneider pulled for an extra attacker. Brodie scored into an empty net from his own end with 39.8 seconds left.
Mike Cammalleri scored for the Devils. Schneider, in his NHL-leading 52nd start, made 23 saves.
"It's just tough to lose that one; it was an important game for us," Schneider said. "They made plays and we made plays, they made mistakes and we made mistakes. But that sequence at the end of the second and beginning of the third cost us. Sometimes you play well and lose. I know how much everyone wanted this game so it's tough. We just have to get up for Friday."
The Devils (25-27-9) had a four-game winning streak end. They will close a six-game homestand against the Boston Bruins on Friday before traveling to play the Columbus Blue Jackets on Saturday. The Devils, who are eight points behind the Bruins for the second Eastern Conference wild card, missed a chance at matching their longest winning streak in two years; they won five straight from Feb. 3-10, 2013.
Monahan scored his Flames-leading 21st goal to give Calgary its first lead 35 seconds into the third period on a power play. Giordano took a shot from the right circle that deflected off Monahan's stick in the slot.
Monahan, 20, is the first Flames player to have consecutive 20-goal seasons to begin his NHL career since Sergei Makarov in 1989-90 and 1990-91. Makarov was 32 in 1991.
The Flames pulled into a 1-1 tie with 13.5 seconds remaining in the second when Glencross, who has been the subject of trade rumors, scored his first goal in 14 games on a backhand off great pass from Joe Colborne.
"Any time you get a goal in the last minute it's a momentum switch," Glencross said. "Right now you have to win games with the spot we're in. You can't lose too many in a row so it was huge for us.
"For me, personally, until I get the call that says I'm something different I'm a Flame. I don't know if [he will be traded] or not; we'll see what happens. … Right now I'm here to win games any way I can and that's the bottom line."
The goal was the first allowed by Schneider in five periods. Schneider, who entered ranked fourth in the NHL with a .926 save percentage and sixth with a 2.22 goals-against average, was coming off a 38-save, 3-0 victory against the Arizona Coyotes on Monday.
The game marked the return of New Jersey native Johnny Gaudreau for the first time as an NHL player. Gaudreau, born in Salem, N.J., had 20:00 of ice time, took two shots and had two steals.
"I felt good, it was exciting to be back in Jersey," he said. "I had a lot of family and friends and it was a pretty special win for me. I felt excited playing in my first NHL game here with a lot of people watching. It was more excitement than pressure."
Gaudreau was asked if he was hoping to score against fellow Boston College alum Schneider. Gaudreau played three seasons for the Eagles and won the Hobey Baker Award as the best college hockey player last season.
"It definitely would have been nice [to score on Schneider] but he made a nice save on me," Gaudreau said. "Hopefully I'll get him next season. This is a really crucial road trip for us, and even though it's special for me, I have to put some of that aside and realize how important this trip is."
Cammalleri gave the Devils a 1-0 lead on a backhand from the slot that beat Ramo between the pads at 17:03. Brodie lost the puck in the neutral zone, giving Jordin Tootoo and Cammalleri on a 2-on-1. Less than two minutes earlier, Schneider stopped Jiri Hudler on a breakaway.
"We talked about their neutral zone and how they have a good transition game and we didn't want to turn too many pucks over," Glencross said. "We wanted to get pucks in and wanted to get pucks and bodies to the net and that's what we did."