The loss dropped Anaheim to 10-24-4 on the season and 1-3-1 halfway through a franchise-record 10-game homestand.
Ryan Strome scored the lone goal for Anaheim, snapping Ersson's shutout bid with 40 seconds to play. Trevor Zegras tallied an assist. John Gibson made 29 saves in his 25th start of the season, his third in a row since returning from a lower-body injury last week.
Joel Farabee, Morgan Frost, Travis Konecny and Scott Laughton scored for the Flyers, who swept a three-game California road trip and improved to 14-17-7 (35 points) on the season. Noah Cates and Kevin Hayes added two assists.
Making his fourth career NHL start, Ersson stopped the first 28 Anaheim shots to earn the win and came within a minute of his first NHL shutout.
The first period belonged to the Flyers as the visitors peppered Gibson's net with 17 shots in the initial 20 minutes and took a 2-0 lead back to the locker room.
Farabee struck first just over seven-and-a-half minutes after puck drop, getting to Cates' deflected shot in the low slot and tucking a backhand bid between Gibson's legs.
The 23-year-old Cates, who would add another assist later on, has back-to-back multi-point games for the first time in his young NHL career.
With the secondary assist, Konecny joined Connor McDavid and Mark Stone as the only NHLers with road point streaks of eight games or more. Konecny is also just the third Flyer with such a streak since the 2001-02 season.
Frost doubled the Philadelphia lead less than three minutes later with a wrister off the rush, using Kevin Shattenkirk as a screen and beating Gibson to the blocker side.
A 2017 first-round pick, Frost has played in 37 of the Flyers' 38 games thus far and is one point shy of matching his NHL career high (16).
Anaheim Hills native Cam York collected an assist on the play, his second career point against his childhood favorite team.
The lead hit three early in the second period on a terrific play by Hayes. As the Flyers went to break the puck out of their own zone, Hayes took a stretch pass on right wing and attacked the Anaheim net on an odd-man rush with Konecny, who opened up for the one-timer and buried Hayes' set up pass before Gibson could push across his crease.
Konecny has five multi-point performances in his last six games, tops in the NHL during that span (since Dec. 20).
Philadelphia shut the door in the third while protecting the lead, playing the tough, defensively-minded style that head coach John Tortorella is known for and eliminating any hopes of an Anaheim comeback with an insurance marker. Laughton scored the back-breaking goal on a wraparound midway through the third, banking his bid from behind the net off the skate of Cam Fowler in the Anaheim crease and over the line.
Strome would ruin Ersson's bid for his first career NHL shutout with 40 seconds to play, cutting to the slot and firing a shot that snuck through netfront traffic and past the Philadelphia netminder. It would be far too little too late for Anaheim though, as less than a minute later the Flyers clinched the 4-1 triumph and road trip sweep.