The Flyers outshot the Maple Leafs 49-17, the most allowed by Toronto this season (topping the 47 to the Chicago Blackhawks in a 3-2 loss on Nov. 1).
Toronto (25-31-5) has won two in a row; Philadelphia (26-25-11) has lost two in a row.
"[Bernier] stole us the game," Maple Leafs captain Dion Phaneuf said. "He was outstanding start to finish. We gave him too much work. We gave up too many key opportunities. We gave up over 45 shots. That's too much work for him. But he was outstanding, he stole the game for us, and we'll take the win."
Prior to winning 4-3 against the Winnipeg Jets on Saturday, Bernier had lost 10 in a row.
"Even in my bad stretch I'm just trying to go shot by shot and not really focusing on the end result," Bernier said. "Tonight we got fortunate I got a few bounces, good blocks, good stick, and a couple big saves, and we found a way to win."
Toronto coach Peter Horachek praised Bernier's performance, but added, "I expect him to play that way all the time. Where are we without him? Your goalie has got to be your best player and sometimes it just has to happen."
The Flyers outshot the Maple Leafs 16-7 in the first period, but Toronto held a 1-0 lead on Phil Kessel's 23rd goal of the season with 2:25 remaining. Kessel outraced Philadelphia defenseman Nicklas Grossmann for a loose puck and then beat goaltender Rob Zepp with a 20-foot snap shot.
Tyler Bozak made it 2-0 at 5:33 of the second period when he broke in alone and his shot went past Zepp, off the crossbar and in. Maple Leafs left wing James van Riemsdyk made a blue line to blue line pass to Bozak, who managed to sneak quietly behind the Flyers defense.
The goal came on Toronto's eighth shot, one of two the Maple Leafs took in the second period. The Flyers responded by replacing Zepp with Steve Mason.
The Flyers led 31-9 in shots after two periods.
Phaneuf returned to the lineup after missing 12 games with a hand injury and scored a power-play goal 1:22 into the third period. The shot from the right point was his third goal of the season.
Philadelphia captain Claude Giroux made it 3-1 at 11:10 of the third with a one-timer past Bernier. The goal, on a power play, was his 18th of the season.
Brayden Schenn scored his 12th of the season 3:17 later on a power play on a rebound to make it 3-2.
"Some nights you are going to play great and get no points and other nights you may play poorly and get points," Schenn said. "It goes both ways. We can't hang our heads because we have a big game coming up Saturday against the [New York Rangers]."
The Flyers remain in the hunt for a Stanley Cup Playoff spot in the Eastern Conference. They are four points behind the Boston Bruins, who hold the second wild card.
"There are no easy games in this league," Schenn said. "You look at the Maple Leafs and they still have a lot of skilled players who can put the puck in the back of the net."
The Maple Leafs have made a number of trades leading up to the NHL Trade Deadline on March 2 and more could be in the works.
"No one is untradeable; I think there's never anyone that's untradeable," said Phaneuf, a subject of some rumors. "Anyone can be moved."