ANAHEIM, Calif. — On Halloween Eve, with the "Monster Mash" blaring from the loudspeakers during pregame festivities and many fans at the Honda Center wearing costumes, the Flyers came disguised as the Tampa Bay Lightning.

In other words, for one night at least, they resembled a quality hockey team.

They scored the first goal for just the second time in 12 games Tuesday, tallied their second power-play goal in their last 21 chances, and showed more physicality than usual.

Oh, and their defense and goaltending rebounded from one of their most dreadful performances of the young season.

It all produced a much-needed 3-2 win over injury-ravaged Anaheim. The Flyers snapped their three-game losing streak and extended the Ducks' losing skid to six straight.

Nolan Patrick scored with 1 minute, 51 seconds left to snap a 2-2 tie. The second-year center scored 21 seconds after Pontus Aberg's power-play goal tied the score at 2-2.

Oskar Lindblom, from behind the net, found a streaking Patrick in the slot and he gave the Flyers the lead for good.

Patrick didn't feel he drilled the shot, but he got enough of it to get it past Ryan Miller, Anaheim's back up goalie.

"One of the worst shots I've taken," Patrick said. "I'm not going to lie to you guys and say I was aiming there."

Lindblom said Miller was "waiting for a high shot" and was fooled by Patrick's low drive. "It can't get any better."

With 3:33 left in regulation, Jordan Weal's tripping penalty gave the Ducks a golden chance to tie the game — and they didn't waste it.

But the Flyers, who outshot the Ducks by a 36-25 margin and outhit them, 25-17, survived because of Patrick's heroics.

"We played a perfect road game," said defenseman Ivan Provorov, who had a goal and five blocked shots, including one that probably saved a goal.

The Flyers spent most of the first period in the Ducks' end and left the ice with a 1-0 lead, thanks to Sean Couturier's power-play goal. It marked only the third time in 12 games they took a lead into the second period.

Early in the first, Scott Laughton nearly made it 2-0, but Miller denied him on a shorthanded breakaway.

Just 1:59 into the second period, after Couturier nearly scored his second goal of the night, the Ducks sped down ice and Aberg beat Brian Elliott (23 saves) from the right circle, firing a shot over his shoulder to knot the score at 1-1.

But the Flyers answered a little over seven minutes later, taking a 2-1 lead when Giroux's wrist shot deflected off Provorov and past Miller as Travis Konecny distracted the 38-year-old goaltender. For Provorov it was his first goal of the season; he shared the NHL lead for defensemen with 17 goals a year ago.

Anaheim, which had points in its previous 15 games (12-0-3) against the Flyers, controlled the early part of the second period. But the Flyers regrouped nicely and had a 17-9 shots advantage in the stanza.

"I thought it was two of our best periods of the year, honestly," said Patrick, who had an assist, scored the game-winning goal, and won 11 of 17 faceoffs (65 percent). "Being on the road gives us a chance to re-set and get better as a team."

Before the game, many Flyers echoed that sentiment, saying that playing on the road would help them get back on track.

They started a four-game trip Tuesday that will also have stops in Los Angeles, San Jose, and Arizona.

"Because of the way things are going, it's probably good to get away," Couturier said. "There's no distractions. Just focus on our game and start the trip the right way. Getting off to a good start is important."

It was Couturier who got the Flyers off on the right skate, deflecting Giroux's pass through his legs and past Miller with 16:53 left in the first, putting the visitors ahead, 1-0, and giving them just their second power-play goal in the last eight games.

"We want to get back to playing the right way and getting some good habits back on our team," Couturier said after scoring his fourth goal of the season. "It was a good start."

During their early power plays Tuesday, the Flyers flip-flopped players on their first and second units. Patrick and Konecny went to the top unit, and Wayne Simmonds and Jake Voracek dropped to the second unit. The Flyers went back to their usual units late in the game.

The Flyers had lost four of their previous five games, and they were coming off Saturday's 6-1 home loss to the Islanders.

"It's a perfect time for us to be on the road," center Jori Lehtera said. "I don't know why, but it feels like we play a more simple game on the road than at home."

It didn't hurt that the Flyers faced an Anaheim team that was missing eight injured regulars and used three rookie defensemen who had played in a combined 46 NHL games in their careers.

"We feel we can build off this and keep going here," Giroux said after his team's first regulation win over the Ducks since 2008..