The Senators (17-27-8) have lost 14 of 15 and haven't won a home game since beating Pittsburgh on Dec. 26.
Kris Draper and Niklas Kronwall also scored, and Jimmy Howard made 29 saves for the Red Wings. It was Detroit's first visit to Ottawa since October 2008.
Milan Michalek scored twice for Ottawa, and Peter Regin had a goal and two assists. Chris Campoli and Alex Kovalev also scored for the Senators.
Robin Lehner was pulled midway through the second period after allowing four goals on 19 shots in his first home start. Brian Elliott allowed two goals on 19 shots in relief.
The Senators took a 1-0 lead on Kovalev's power-play goal, but Franzen scored twice in 48 seconds to put Detroit ahead.
Ottawa retook the lead when Regin and Campoli both scored their second goals of the season.
After a slow start to the second period the Red Wings scored twice in a span of 13 seconds to go back in front. Lehner made two great saves, but couldn't stop Draper on the third attempt as he beat the rookie over the shoulder.
On the ensuing play, the Red Wings took control and continued to pressure Ottawa deep in its end before Nicklas Lidstrom found Kronwall at the blue line. Kronwall drilled a shot through traffic and beat Lehner through the legs.
That marked the end of Lehner's night. The home fans didn't appreciate the goaltending change as Elliott, who has lost his last 11 starts, was soundly booed.
Franzen completed his hat trick with a power-play goal 30 seconds into the third, beating the Elliott to the short side.
The Senators tied it 5-5 just 29 seconds later when Michalek scored his second of the night.
Back-to-back penalties gave the Red Wings a two-man advantage for 68 seconds, and they made the most of it as Franzen scored his fourth of the game to make it 6-5.
The Senators appeared to tie it again with just under eight minutes remaining, but the goal was disallowed on the ice. The call was then confirmed by video review.
Franzen capped the scoring with an empty-net goal.
Notes: Ottawa D Matt Carkner was a healthy scratch. LW Jarkko Ruutu was back in the lineup after missing the last three games. The Senators were without G Pascal Leclaire (lower body) and C Jason Spezza (shoulder). ... Detroit was without C Pavel Datsyuk (hand), C Mike Modano (wrist), LW Thomas Holmstrom (hand), G Chris Osgood (groin), and D Brad Stuart (jaw).