Philadelphia has lost four straight and five of six overall.
"It's not good enough at all, by any stretch," said Flyers coach Peter Laviolette, whose team fell two points behind Washington in the East after the Capitals beat Toronto in shootout.
The Flyers have dropped seven straight and 10 of their past 11 at Scotiabank Place, with the last victory coming Nov. 24, 2007.
Mike Richards scored both goals for the Flyers, who failed to clinch the Atlantic Division title.
"It was a big game for us, and pretty much the whole team came out flat and didn't really help our goalie," Flyers right wing Claude Giroux said. "We've got two games left, and I don't think you can turn on a switch when playoffs come, so I think the next two games are going to be huge.
"If we play like that in the playoffs, we'll be in trouble."
"I think this is going to be one of the games that guys think about over the summer," Senators right wing Ryan Shannon said. "They're going to be a good playoff team, and showing that we can hang with a team like that is a good feeling."
The Senators have won two of three and four of their past five at Scotiabank Place to improve to 15-20-5 at home.
Butler scored at even strength on a breakaway late in the second period to give the Senators a 3-2 lead. Spezza's 20th goal of the season came on the power play at 8:02 of the third to push Ottawa up two. The Senators scored three times with the man advantage.
"They're probably the best team in the East, and it's a big challenge for us," Spezza said. "I think the game probably means more to us than it does to them, and these are important games for us to gain confidence. I think we accomplished that tonight, and it feels good to get the win."
Kimmo Timonen assisted on both goals, and Sergei Bobrovsky stopped 31 shots for the Flyers, who have only two wins in the past nine. Philadelphia played without center Daniel Briere for the second straight game because of a lower-body injury.
The Flyers made it 1-0 on the power play when Richards picked up his own rebound off a blocked shot and wired the puck past Anderson at 3:40 of the first.
Philadelphia was soon back on the man advantage after Ben Holmstrom appeared to catch Ottawa's Zack Smith with a high hit. With no penalty called on the play, Senators right wing Chris Neil took Holmstrom to task for the check and received an instigator penalty and 10-minute misconduct in addition to the players' fighting majors.
The Flyers failed to take advantage, however, and Foligno redirected a pass from Spezza past Bobrovsky on Ottawa's power play at 15:37.
Power plays also accounted for the next two goals with Richards taking a pass from Nikolai Zherdev in the slot and beating Anderson with his 23rd goal of the season at 15:56 of the second to make it 2-1.
It was short-lived, however, as Shannon answered less than 2 1/2 minutes later with a shot from the point through traffic.
In the final seconds of the period, Smith sprung Butler on a breakaway and he scored to give the Senators a 3-2 lead.
Michalek scored into an empty net with 18 seconds left.
"We know the team we've got in here is a good team; we're not worried about that," Flyers forward Kris Versteeg said. "We've just got to find ways to win and change that Friday [at Buffalo] and get on to a roll and make good plays, plays we know we can make, going into the playoffs."
The Senators recalled F Roman Wick, D Andre Benoit and D Patrick Wiercioch from Binghamton of the AHL for the game. ... Ottawa wraps up its home schedule Thursday against the Montreal Canadiens. ... Foligno has declined USA Hockey's invitation to join its team for the upcoming world championship in Slovakia. ... After the game, the Senators gave their shirts away to randomly drawn season-ticket holders. ... The Flyers placed G Michael Leighton on waivers Tuesday. ... Flyers C Blair Betts sat out the game with a lower-body injury suffered Sunday against the New York Rangers. He's listed as day-to-day. ... The Flyers don't play again until Friday, when they visit Buffalo.
Copyright by STATS LLC and The Associated Press
Arena: Scotiabank Place Location: Ottawa, Ontario
Referees: Don VanMassenhoven, Francois St. Laurent Linesmen: Steve Barton, Scott Cherrey
Attendance: 18,397 (99.4% full)
Team Stat Comparison
Power Play Goals
Power Play Opportunities
Shots on Goal
Mike Richards (22)
(Power Play) Assists: Kimmo Timonen, Claude Giroux
Nick Foligno (14)
(Power Play) Assists: Jason Spezza, Filip Kuba
Mike Richards (23)
(Power Play) Assists: Nikolay Zherdev, Kimmo Timonen
Ryan Shannon (11)
(Power Play) Assists: Jason Spezza, Filip Kuba
Bobby Butler (8)
Assists: Zack Smith, Jason Spezza
Jason Spezza (20)
(Power Play) Assists: Ryan Shannon, Bobby Butler
Milan Michalek (18)
(Empty Net) Assists: Jesse Winchester, David Hale