PHILADELPHIA -- Jeff Carter celebrated the big 4-0 for the Flyers.
Forty goals, 40 home wins and plenty more reasons for Philadelphia to feel its best hockey is ahead as the postseason get closer.
Carter scored his 40th goal and Gagne his 30th only 2:06 apart to hand Martin Brodeur only his third loss in 12 games since returning from biceps surgery.
"We really feel like we're starting to get into that groove," Carter said. "We're playing solid D, Marty's standing on his head making saves when we need them and guys are leaving it all out there."
The Flyers have won three straight behind Biron and got a goal and an assist from Daniel Briere.
Briere has bounced back into form since returning from the groin injuries that cost him most of this season. He has three goals and two assists during the winning streak, helping the Flyers keep their hold on fourth place in the Eastern Conference.
The Flyers followed three losses in four games with road wins at Buffalo and Pittsburgh and now a victory against the Atlantic Division leaders.
"It was just a matter of time for us to get back on track," Briere said.
Biron stopped 32 shots and heard the "Marty! Marty! Marty!" chants that were so familiar when he led the Flyers to the Eastern Conference finals last year. Biron entered the game with a 2.73 goals-against average, the lowest it's been this season. He is 10-4 in his last 15 appearances, including a 27-save effort in Sunday's win at Pittsburgh.
"You kind of sense that same feeling that the playoffs bring and the desperation and that kind of atmosphere," Biron said. "It was entertaining."
Biron got some offensive help in a flash to open the third.
Carter knocked in Kimmo Timonen's shot 55 seconds into the period for his 40th goal, putting him third in the NHL. Claude Giroux led the attack moments later and dumped the puck behind him to Gagne, who scored from the red line to make it 4-2.
Carter is the 13th Flyers player to hit the 40-goal mark in a single season and it's the 37th time in team history that feat has been accomplished.
"It's cool," Carter said of his milestone. "It's obviously nice to be able to help the team out and score some goals. It's definitely a good feeling. It's a good feat for myself and help from some good teammates."
Biron kept the Devils in check from there and the Flyers killed a four-minute power play after Daniel Carcillo was whistled for high-sticking. The Flyers are the only team to not allow a short-handed goal this season.
Gagne and Timonen each had two assists.
Patrik Elias sat out for the Devils because of lower body soreness after he was hurt Sunday against Boston. Elias, who has 30 goals and 77 points this season, is day to day.
Shanahan was back, though, after missing the loss to Boston and he gave the Devils a 1-0 lead early in the second when a shot from Dainius Zubrus struck his skate and went past Biron for his fifth goal.
The goal was reviewed but it stood because there was no distinct kicking motion.
Briere tied it with a power-play goal off a sharp pass from Timonen. Timonen faked a slapper but made a perfect feed to Briere just outside the crease, who punched it past Brodeur for his eighth goal.
"We gave them a lot of room out there. They found ways to attack the net and get goals," Brodeur said. "It was kind of obvious that we had some breakdowns in the open ice. We gave up some untimely goals."
Briere helped put the Flyers ahead in the second when he controlled the puck in the right circle, getting Brodeur to sneak out and face the Flyers center. Briere instead passed the puck to Mike Knuble, who pounded in his 26th goal and a 2-1 lead.
Briere has played in only 19 games this season because of groin and abdominal injuries. He is still not 100 percent but believes he is rounding into form toward the end of the season -- just like the Flyers.
"It seemed a week ago we were in a funk we were trying to get out," Briere said. "Teams were creeping up on us in the standings so this is a big step in the right direction for us."
Langenbrunner scored his 25th from the slot on the power play to make it 2-2.
"We made some mistakes on special teams and gave them too many chances," Langenbrunner said. "We've got to be able to kill penalties."
The Devils' road slump continued, as they dropped their third straight and four of five outside New Jersey.
The Devils hadn't lost two straight since Jan. 6-8. ... Knuble played in his 300th game with the Flyers. ... Gagne has at least one point in 10 of 11 games. He had his 26th career three-point game. ... Elias broke the Devils' franchise record for points last week, topping John MacLean's mark. ... The Flyers are 8-4-3 in the second game of back-to-backs.