Wayne Simmonds gave Philadelphia a 2-0 lead less than four minutes later, and Gagne scored his first goal of the season in the second period, one day after being reacquired by the Flyers from the Los Angeles Kings.
Max Talbot stretched the advantage to 4-0 in the second, chasing goalie Braden Holtby to the bench just one day following his home shutout of Carolina. Talbot's slap shot hit the camera inside the net and quickly ricocheted out.
Ilya Bryzgalov made 23 saves and was in line for a shutout until Joel Ward tipped in his own deflection with 2:09 left to cut the Capitals' deficit to 4-1.
Gagne, who will turn 33 this week, was acquired Tuesday from the defending champion Kings for a conditional draft pick. He took a red-eye, cross-country flight and appeared in his first game after being a healthy scratch for the past five games with the Kings.
Gagne, who hadn't scored since Nov. 17, 2011 - a span of 28 games. He missed the final 46 games of last season because of injury.
A highlight video of Gagne's first stint with the Flyers was shown during the first period, officially welcoming the popular forward back to Philadelphia, where he spent his first 10 NHL seasons before being traded to Tampa Bay in 2010.
He seemed unaware of the video, at first, but then acknowledged the cheering crowd with a half-wave. Gagne received a louder ovation when he took a pass from Brayden Schenn feed and slammed a shot past Holtby for a 3-0 lead.
The Flyers have trailed 1-0 in 12 of their 20 games this season, but Giroux and Scott Hartnell combined to give them a quick strike on Wednesday. From his knees, Hartnell flipped the puck back to Giroux, who fired a rising shot past Holtby. It was the fourth time this season the Flyers scored in the first minute.
Hartnell, in his fifth game since returning from a broken left foot, added another assist on Simmonds' power-play goal. As Simmonds spun away from the net, he managed a backhanded flip that eluded Holtby.
Philipp Grubauer then made his NHL debut in relief of Holtby, and blanked the Flyers the rest of the way. Grubauer was called up on Tuesday from the Hershey Bears of the American Hockey League. The Capitals (7-11-11) lost for the third time in eight games.
NOTES. Flyers D Erik Gustafsson left the game shortly after blocking a shot in the second period and didn't return. The team said he has a lower-body injury. ... Gagne's goal was his 260th with the Flyers. . Holtby made his eighth consecutive start for the Capitals. He was supposed to rest on Wednesday, but got the start because regular backup Michal Neuvirth was sick. . Edmonton Oilers executives Kevin Lowe and Craig MacTavish watched the game from the press box.