PITTSBURGH - For the Flyers, the last five weeks haven't been a thud-to-earth crash. More like slow-motion torture, filled with some good periods, some listless ones, a point here, a loss there.

But the lethargic stretch, which followed 41/2 months of consistency that spawned Stanley Cup talk, forced them into desperation mode Tuesday night for the first time in, well, the entire season.

The desperation remedied their listlessness.

Snapped to attention by their shrinking first-place lead, the Flyers, aided by Ville Leino's two third-period goals, responded with a 5-2 win over Pittsburgh at the Consol Energy Center.

"It's sometimes tough when teams aren't that close to you. . . . It's not always easy to get ready for games," conceded Leino after scoring his 18th and 19th goals of the season. "And now teams are close to us, and this was a desperate game, and we played good. We got excited, and it was like a little bit of a playoff game for us, and probably for them, too, so it was a lot of fun."

"I wish we wouldn't wait until are backs are against the wall, but that showed a lot of character in this team," said veteran defenseman Sean O'Donnell, who contributed a pair of assists. "We got down 2-1; it's a big rivalry with these guys, and we were able to battle back."

With a stunned, standing-room-only crowd watching, Jeff Carter, Scott Hartnell and Claude Giroux also scored for the Flyers, who moved four points ahead of the Penguins in the Atlantic Division and Eastern Conference. The Flyers have six games left - one more than Pittsburgh, which could have moved into a first-place tie with a regulation win.

The Flyers set a single-season record for road victories. They are 25-9-4 on the road, including wins in all three games in Pittsburgh, the first time they had swept a series there since 1983-84. Goalie Sergei Bobrovsky, who regrouped and made 14 third-period saves after allowing a soft goal in the second period, notched all three victories.

The Flyers also moved three points ahead of Washington in the East. Their magic numbers: seven points for the conference and six points for the division.

If they went 3-2-1 the rest of the way, for instance, they would win the East - regardless of what the Caps do.

Nineteen seconds after coach Peter Laviolette called a timeout, Leino made it 4-2 when Hartnell's shot deflected off his body and past goalie Marc-Andre Fleury with 14 minutes, 30 seconds left. A little over three minutes later, a determined Leino scored from the side of the net, flipping his own rebound softly over Fleury's shoulder to give the Flyers a 5-2 lead.

Leino entered the night with just four goals in his last 22 games.

Danny Briere had two assists as the Flyers finished their season series with a 4-1-1 record against the Penguins. They had just three giveaways - 17 fewer than in Sunday's loss to Boston.

After showing little offense in the first 33 minutes, the Flyers scored twice in a 47-second span late in the second period to take a 3-2 lead.

Hartnell took a pass from Kimmo Timonen, wheeled around, and scored from in front to tie it at 2 with 6:15 left in the second. The Flyers had been 1 for 18 on the power play before Hartnell converted with Paul Martin in the penalty box for interference.

Just 47 seconds later, Giroux, after slick feeds by Andrej Meszaros and O'Donnell, made a deft move on defenseman Kris Letang to get shooting space, and he beat Fleury from the high slot, giving the visitors a 3-2 lead. It was Giroux's fifth goal in six games against the Penguins this season, and he scored the game-winner in all three games in Pittsburgh.

"It's nice to get a lead on this team because they're very structured - especially with the two key injuries they have," said O'Donnell, referring to Penguins stars Sidney Crosby and Evgeni Malkin. "They really rely on playing solid defense. They don't give you much, so when they got the 2-1 lead, that's kind of like New Jersey used to be, or Boston. When they get the lead, they play differently.

Taking the lead back "made them open up a little bit," O'Donnell said. "I'm not saying that's why we scored the two in the third, but playing ahead of these guys is way better than playing from behind."

The only negative for the Flyers was that Timonen suffered a lower-body injury and did not play the third period. General manager Paul Holmgren said Timonen was day-to-day and that the injury was not serious.

Contact staff writer Sam Carchidi at scarchidi@phillynews.com. Follow him on Twitter at www.twitter.com/BroadStBull.