The Bruins have won nine straight road games, a single-season club record.
Reilly Smith, the fifth Boston shooter, clinched the victory in the shootout for the Bruins, who ended March 15-1-1.
Vincent Lecavalier scored twice for the Flyers, including the game-tying goal with 25 seconds left in regulation. Lecavalier's first goal was the 400th of his career.
Kimmo Timonen scored for Philadelphia, which has lost three of four to remain in third place in the Metropolitan Division.
Andrej Meszaros and Zdeno Chara also scored for the Bruins.
Bergeron opened the shootout by scoring for the Bruins and Claude Giroux, Philadelphia's second shooter, tied it. But no other Flyers shooter scored.
The Bruins' last road setback came in overtime Feb. 26 at Buffalo, and they haven't lost in regulation since a Jan. 9 defeat at Los Angeles.
Lecavalier scored his second goal with 25 seconds left. With goalie Steve Mason on the bench, Philadelphia pressed into the Boston zone. Johnny Boychuk had a chance to clear the zone, but the puck bounced over his stick on a backhand clearing attempt and went right to Jakub Voracek.
Tuukka Rask contested Voracek, who passed in front to a wide-open Lecavalier.
It looked as if Boston had it won in regulation.
Boston erased a one-goal deficit with a pair of second-period goals.
Chara scored on the power play 5:44 into the period. Jarome Iginla set Chara up for the goal with a pass in front of the net, and Chara wheeled to his backhand and lifted it past Mason to the far side of the net.
Bergeron continued his torrid pace with a goal in his seventh straight game, this one with 8:55 left in the period to give the Bruins a 3-2 advantage. Bergeron whirled around from the left circle and his turnaround shot slipped under Mason's pads.
The Flyers led 2-1 after an action-packed first period. Lecavalier opened the scoring just over five minutes into the game by beating Rask with a slap shot from the point that dipped under Rask's glove.
Meszaros, who the Flyers traded to the Bruins at the trade deadline for a conditional third-round pick, tied it just over five minutes later when his wrist shot from the slot got past Mason on the stick side after Philadelphia had trouble clearing the zone.
Philadelphia's Zac Rinaldo raised the excitement level with a hard check on Iginla with just over four minutes left in the period and the players subsequently were penalized for fighting in a one-sided affair in favor of Rinaldo.
Timonen gave Philadelphia a one-goal lead with 41.7 seconds left in the period by finishing an excellent cross-ice, back-handed pass from Voracek with a one-timer from the edge of the left circle.
Notes: The Bruins won eight straight on the road during the 1971-72 and 1992-93 seasons. . Lecavalier became the 90th player to reach 400 goals. . The Bruins are the only team in the NHL against which the Flyers have a sub-.500 record all-time in Philadelphia. . Steve Downie (upper body injury) missed his fourth straight game for the Flyers. . Boston improved to 2-0 against the Flyers this season, counting a 6-1 win at Philadelphia on Jan. 25. The teams will conclude the regular-season series at 1 p.m. Saturday in Boston. . Boston improved to 13-2-0 in the second game of a back-to-back this season. The Bruins skated to a 4-2 win at Washington on Saturday.