Alfredsson was held without a point by his former team. The Swedish winger spent 17 seasons with the Senators before signing a one-year deal with the Red Wings in the offseason.
''It was different seeing them on the other side,'' Alfredsson said. ''Once the puck dropped in the game you focus on what you're going to do out on the ice. It didn't feel as awkward as I thought it would.''
Craig Anderson made 31 saves for Ottawa.
Todd Bertuzzi scored for the Red Wings.
Spezza is Ottawa's captain, a role Alfredsson filled previously. Spezza has seven goals on the season, trailing only Washington's Alex Ovechkin, who leads the NHL with nine.
''I was learning to be captain from Alfie when he was here and now I'm trying to do that,'' Spezza said. ''We found a way to beat one of the best teams in our division and we'll try to use that as a springboard to keep playing better.''
The Senators won at Detroit for the first time since 2006, although this was only their third road game against the Red Wings since then. Detroit moved to the Eastern Conference this year.
Gryba opened the scoring, beating Howard from the right circle after Detroit defenseman Danny DeKeyser couldn't control the puck behind the net.
Spezza made it 2-0 on a power play, shooting through traffic from the left circle. After Detroit's Kyle Quincey was called for tripping, the Senators needed only 7 seconds to score again with the man advantage, this time on Ryan's wrist shot to Howard's stick side with 5:46 remaining in the first period.
Jonas Gustavsson replaced Howard, and Bertuzzi scored a couple minutes later, stuffing the puck past Anderson on the power play.
''It's disappointing for us to lose the way we did at home tonight,'' Alfredsson said. ''I would have loved to win this one no question, but we played a good game against San Jose (on Monday) and now we took a step back.''
Anderson made a sprawling stick save on Pavel Datsyuk at the start of the second period, and Spezza made it 4-1 with his second goal of the night. His initial shot missed the net but bounced right back to him from the end boards, and he was able to shoot past a startled Gustavsson.
''I know the boards are live - I didn't try to do it on purpose,'' Spezza said. ''I tried to put it in on the first shot, it missed the net and came right back to me. I do know the boards are live here. We were looking at it this morning. I wish all the boards were like this.''
Cowen scored early in the third when his shot from near the left point slipped past Gustavsson. Ryan scored on a rebound to make it 6-1.
Alfredsson is Ottawa's career leader in games (1,178), goals (426), assists (682) and points (1,108), but he had a quiet game Wednesday, along with the rest of the Red Wings. Alfredsson had two shots and was called for a third-period tripping minor.
''Their team came prepared to play and skated us into the ground. We didn't play at all - couldn't keep it out of our net, we didn't skate good and turned tons of pucks over,'' Detroit coach Mike Babcock said. ''I didn't see it coming. I was surprised to say the least. Disappointed for Alfie that we couldn't have done a better job here.''
NOTES: Detroit D Niklas Kronwall was back on the ice after missing two games with a concussion. He assisted on Bertuzzi's goal. ... The Senators were 3 for 24 on the power play entering the game. ... Gustavsson made 17 saves in relief. ... It was the most goals scored by Ottawa this season and the most allowed by Detroit.