With overtime looming, Matt Hunwick took his best shot at a winner for Toronto.

Hunwick's slapper connected in the clutch, off a defenceman's knee, and lifted the Maple Leafs to a 3-2 win over the hometown Philadelphia Flyers on Tuesday night. His first goal of the season snapped Toronto's five-game losing streak.

"I'll take it any way I can get it," Hunwick said. "I'm glad it was a goal that helped the team win an important game.

Joffrey Lupul and Roman Polak also scored for the Maple Leafs. James Reimer stopped 31 shots for Toronto.

Matt Read and Shayne Gostisbehere scored the Flyers, who lost for just the second time in seven games and failed to crack the Eastern Conference playoff standings.

The Flyers had won five of six entering Tuesday and thrust themselves into the Eastern Conference playoff picture. Based on results from other games, the Flyers had a chance to sit in eighth place in the East.

'I'd say [we were] a little bit complacent. You're not going to win any games when we have close to 20-something turnovers.' - Flyers forward Matt Read on Tuesday's 3-2 loss to Toronto

While a modest achievement for late January, it would have been a nice step for a Flyers team that missed the playoffs last season and whose coach, Dave Hakstol, never coached in the NHL and made the jump from college.

The Flyers instead left two huge points on the ice and trudged to the dressing room to boos from the crowd.

"I'd say [we were] a little bit complacent," Read said. "We weren't moving our feet, we were turning over a lot of pucks, and you're not going to win any games when we have close to 20-something turnovers."

Hunwick's shot deflected just enough off defenceman Michael Del Zotto and past a surprised Steve Mason. Mason stopped 32 shots.

The Maple Leafs entered with the fewest wins in the NHL and had a punchless offence over their recent losing skid. They led 2-1 until Gostisbehere came through for the Flyers late in the third.

Leafs goal overturned

The Maple Leafs appeared to go up 2-1 early in the second when they scored off a Flyers' turnover. But the goal was reviewed and overturned on an offside penalty against the Maple Leafs.

They wasted little time taking the lead again, and this time it stuck. With 4:50 left in the period, Lupul, a former Flyer, made it 2-1 with his 10th goal of the season and first since Dec. 21.

Both teams scored a goal in the first.

Toronto had a rare reason to celebrate this season.

"I think your determination should show every night," coach Mike Babcock said. "Not every second night or every third night or when you're feeling good. Every night. That to me is the goal for our team, that we're prepared and that we compete every single night."