Sebastian Aho had a goal and an assist, Teuvo Teravainen scored and Cam Ward made 21 saves for the Hurricanes (28-25-11), who were 0-4-2 in their previous six games.
Carolina trails the Columbus Blue Jackets by two points for the second wild card into the Stanley Cup Playoffs from the Eastern Conference.
\[WATCH: All Hurricanes vs. Flyers highlights\]
Travis Konecny scored, and Petr Mrazek made 31 saves for Philadelphia (34-20-10), which had its six-game winning streak and 12-game point streak (10-0-2) end. It was the the Flyers' first regulation loss since Feb. 1. It also was Mrazek's first loss in four games since being traded from the Detroit Red Wings on Feb. 19.
Philadelphia is second in the Metropolitan Division, one point behind the first-place Washington Capitals and two points ahead of the third-place Pittsburgh Penguins.
Williams had his first three-point game of the season and his first two-goal game since Jan. 15, 2017, against Philadelphia. The forward was selected by the Flyers with the No. 28 pick of the 2000 NHL Draft and played his first four seasons with them.
"Yes, it's special," Williams said. "My wife's family is from here, I have a lot of friends here, this is where I started. It's always special, absolutely."
Williams made it 1-0 at 4:40 of the first period. As a power play was ending, Jeff Skinner's shot from left side squeezed between Mrazek's pads, and Williams tapped it in.