The Flyers moved four points ahead of the Washington Capitals for third place in the Metropolitan Division, having played two more games.
Justin Brazeau and Danton Heinen scored for Boston (41-16-15), which has lost two straight games in regulation for the first time since Dec. 22-23. Ullmark made 26 saves.
The Bruins lead the Florida Panthers by two points for first in the Atlantic Division. Florida lost 4-3 at the New York Rangers in the shootout Saturday.
"I think just the belief in this group, I don't think at any point in the game did we think we were going to lose it," Brazeau said. "I was pretty confident we would win throughout the game."
Konecny put the Flyers ahead 1-0 at 18:15 of the second period with a power-play goal. Ryan Poehling held a loose puck in at the right point and passed down the wall to Scott Laughton. He centered to Foerster, who flubbed the shot, but the puck rolled to Konecny, who scored from the post on the left side.
Brazeau tied it 1-1 at 10:19 of the third period when he skated through the crease and scored on a backhand. It was his fourth goal in three games.
"[Charlie] Coyle made a great play to get me the puck," Brazeau said. "I looked up and thought my best chance was going to the back post and I got lucky, and it went in."
Konecny put the Flyers in front 2-1 at 15:16 with a shot from the left face-off circle through a screen. The goal gave him 30 for a second straight season (31 in 2022-23).
"I try not to think about that," Konecny said. "It's awesome. I'm happy. But it's just so important for us to stay focused on the end of the season and what the end goal is for us. I think truly right now no one cares about their personal stuff. You just have to get in [to the Stanley Cup Playoffs]."