Brett Connolly beats Flyers goalie Carter Hart for the first of his two goals Thursday night in the Capitals’ 5-2 win at Philadelphia. (Tom Mihalek/Associated Press)

Brett Connolly didn’t react at first, calmly turning away from the net upon seeing the puck go into it. But then the emotion seeped out. Connolly kicked up a leg as he swung his fists to his side and screamed. On this night, he was the Washington Capitals’ greatest scoring threat — not Alex Ovechkin or Nicklas Backstrom or T.J. Oshie or any of the team’s other offensive fixtures.

The Capitals beat the Philadelphia Flyers, 5-2, with their depth Thursday night at Wells Fargo Center, getting the type of varied scoring that made Washington a Stanley Cup champion last season. It’s what the team will need again if it hopes to defend that title when the playoffs start in a month. This win, which featured two goals and three points from Connolly and 22 saves from Braden Holtby, kept the Capitals in first place in the Metropolitan Division.

“We were just emotionally engaged right from the first shift,” center Lars Eller said. “We just caught them early. We executed, did the right things and got rewarded.”

Washington expected desperation from the Flyers, who came in just five points out of a wild-card spot. Their 15-4-2 record since the all-star break impressively vaulted them back into postseason contention after a miserable first half, and with the Eastern ­Conference standings so tight, Thursday’s contest was essentially a must-win for Philadelphia. While 20-year-old rookie goaltender Carter Hart returned in net, the Flyers were without top forward Jakub Voracek, serving the second game of his two-game suspension for interference.

Washington had its own reasons for desperation. The Capitals started the night atop the Metropolitan by just two points, and while players have largely shrugged off the importance of winning a fourth straight division crown, it could mean an easier matchup in the first round and then home-ice advantage for the second round. Just as they did in this building a week ago, the Capitals started well with Connolly scoring just 2:53 into the game when defenseman John Carlson batted down a puck to keep it from sailing out of the zone and Michal Kempny found Connolly open at the back door.

Washington’s third line produced a second goal 9:30 into the frame. This time, Connolly fanned on a shot, but the puck fortuitously bounced right to Eller in front of the net. Hart stopped Eller’s first attempt, but Eller scored on his own rebound to lift the Capitals to a 2-0 lead. He has three goals in his past four games, and that trio getting hot has played a large part in the team winning eight of its past nine.

“Their line basically won us the game tonight,” Holtby said.

Eller and Connolly have played beside each other for the vast majority of their three years together in Washington, and Carl Hagelin, acquired in a trade with Los Angeles three weeks ago, is their newest linemate, complementing the other two with his speed and aggressive forechecking. In his first 10 games with the Capitals, Hagelin has two goals and three assists.

“Carl brings an important element with his speed, and he’s fit in easily because he’s very predictable to play with,” Eller said. “I know where he’s going to put the puck next, and he’s easy to read off, so that has been a good fit. And I always had good understanding and chemistry with Conno. That doesn’t happen too often where you get a new guy and you can expect it to work right away, but it’s been good in this case.”

Washington got out to a two-goal lead against Pittsburgh two nights earlier, but the Penguins responded with three unanswered goals in less than two minutes in the second period, taking the lead and not relinquishing it. The Flyers trimmed the Capitals’ lead just 1:03 into the second period, with forward James van Riemsdyk scoring on a shot through traffic just three seconds after Philadelphia’s power play expired.

But Washington was able to regain its two-goal margin with Connolly’s second goal and third point of the game. Philadelphia’s Philippe Myers couldn’t corral the puck at the Flyers’ offensive blue line, and Connolly carried it up the ice before sniping it over Hart for his 19th goal of the season.

A top-10 draft pick in 2010 by the Tampa Bay Lightning, Connolly struggled to live up to expectations with his offensive production. But under less pressure in a third-line role for the Capitals, Connolly has flourished. He posted back-to-back 15-goal seasons (career highs) before this one and is poised for his first 20-goal, 40-point campaign.

“I just feel really comfortable out there,” Connolly said. “Just in different situations, I just feel confident. It’s just been a really good fit for me here — I’ve said it a million times — and the guys let me come in and be myself and just let me play. It’s definitely the most fun I’ve had playing hockey this year.”

The timing couldn’t be better, with Connolly set to become an unrestricted free agent this summer. General Manager Brian MacLellan said in January that the Capitals would be interested in re-signing him, but with the team typically spending to the salary cap ceiling, it would largely depend on how much financial flexibility the team has after extending 23-year-old winger Jakub Vrana, a pending restricted free agent.

After Washington’s third line accounted for the team’s first three goals, the fourth came from forward Tom Wilson, who punched in center Evgeny Kuznetsov’s feed from the high slot. That was his 20th goal, and Kuznetsov snagged the puck as a keepsake for Wilson, who reached the milestone for a first time. He’s the fourth Capitals player with at least 20 goals this season, another testament to what can make Washington a challenge to match up against in the playoffs.

“Every game is tough at this point in the season,” Wilson said. “You’ve got teams that are desperate, you’ve got teams kind of playing their best hockey, and you’ve got to be ready. I thought from the drop of the puck, we were playing a team game.”