Trailing Washington by three goals early in the second period Tuesday night, the Flyers changed goalies and changed their fortune.

They appeared headed toward a dramatic comeback victory before a late goal in regulation tied it, and the shorthanded Capitals emerged with a 5-4 shootout victory to move within one point of the first-place Flyers in the Eastern Conference.

"In the last few months, I think it was, by far, our best game," center Claude Giroux said after a scintillating two-point performance in which his line - with Andreas Nodl (goal, assist) and Jeff Carter - was dominating. "We worked hard and it was a fun game to play. It was a playoff atmosphere."

With a sellout crowd watching at the reverberating Wells Fargo Center, the Flyers had the puck at the Caps' end most of the night and held a 33-23 shots advantage.

"I think most of it was positive. The ending was not, but overall I thought it was a solid effort from our team," said Danny Briere, whose goal with 5 minutes, 45 seconds left in regulation gave the Flyers a brief 4-3 lead. "There's going to be nights like that where you get some bad bounces. Our goalies got some bad bounces on them, but overall I think it was the type of game we need to play."

Alexander Semin scored the game-winner in the shootout, during which the Caps were 3 for 3 against Brian Boucher, who replaced a shaky Sergei Bobrovsky (three goals allowed on nine shots) early in the second period.

"From a team standpoint, I think it was a good point," Boucher said. "From my standpoint, I'm disappointed. I didn't make any saves in the shootout, and for that I feel I could have done more."

Ville Leino and Briere scored for the Flyers in the shootout, while Giroux didn't connect - he lost control of the puck and didn't get off a shot.

After Briere tipped in Kimmo Timonen's drive to make it 4-3, the Caps' Marcus Johansson tied it from the left circle with 3:19 remaining, capitalizing on a nice setup by former Flyer Mike Knuble (goal, two assists).

Giroux took advantage of defenseman Jeff Schultz's turnover deep in his end, tipping the puck to Nodl, who scored from out front with 10:02 left to tie the game, 3-3. It was his second goal in his last 29 games.

In the final minute of the second period, it was Nodl who made a great cross-ice feed to set up Giroux's goal to get the Flyers within 3-2.

The Caps have won 11 of their last 12 games to inch closer to first. The Flyers have two games in hand.

Washington was playing without two of its marquee players, left winger Alex Ovechkin and defenseman Mike Green, but it didn't seem to bother the Capitals in the first 20 minutes.

Then again, the Caps were helped by Bobrovsky, who has struggled against high-quality teams this season. He is 10-9-3 against teams that are in a playoff position.

Washington didn't have many chances, but it still built a 2-0 first-period lead on goals by Nicklas Backstrom and Knuble.

Backstrom scored as he split two defenders, cruised over the blue line, and fired a shot from the high slot that deflected off Bobrovsky and appeared to go under his left elbow. The soft goal put the Caps ahead, 1-0, after 7:52.

Washington made it 2-0 as Knuble made a nifty move to get around Sean O'Donnell and knocked the puck behind the net to Jason Chimera. Chimera threw it out front, where a diving Knuble - despite getting cross-checked from behind by O'Donnell - tipped the puck past a slow-reacting Bobrovsky on the short side.

"I don't think we had a bad first period," Giroux said after the team's third straight shootout. "The bounces just weren't going our way."

Less than 1½ minutes into the second period, Washington increased the lead to 3-0 as Dennis Wideman scored a power-play goal on a blue-line drive that appeared to deflect off Nodl and change direction, bouncing off a screened Bobrovsky.

Exit Bobrovsky. Enter Boucher.

The Flyers trimmed the deficit to 3-1 as Kris Versteeg sent a crossing pass that deflected off Wideman and past goalie Michal Neuvirth with 11:55 left in the second period.

With 33.8 seconds left in the period, Giroux converted Nodl's pass and the Flyers had climbed to within 3-2.