The win coupled with Tampa Bay's 4-0 loss to Boston means the Senators need just one point in their final three games to clinch a playoff spot.
"It was a little longer than I expected but it hits home," Anderson said of a pregame ceremony where he was recognized for reaching the 500-game milestone on March 25 in Montreal.
"It's definitely emotional, but the guys rallied around it and I rallied around it and we got a great all-around effort."
The win also snapped a five-game losing streak for Ottawa and was just its third victory in its past 12 games.
Jimmy Howard made 22 saves in the loss for the Red Wings, who are playing out the string as they will miss the playoffs for the first time in 25 seasons.
"You've got a lot to play for. You play for the wing-wheel on your chest. That's what we do," Red Wings captain Henrik Zetterberg responded when asked what it's like with nothing to play for.
He then spoke about the last two games of the season -- also the final two games at the Joe Louis Arena.
"We've got two games left and it's going to be an exciting weekend for us first with Montreal on Saturday and then the last game at the Joe."
It was also an important game for Clarke MacArthur, who made his season debut for the Senators and played his first game since Oct. 14, 2015, because of concussion issues.
Earlier this year Ottawa general manager Pierre Dorion said MacArthur had been shut down for the season when MacArthur failed the necessary concussion baseline test in January.
Last week while the Senators were on the road he passed another baseline test.
MacArthur played just under 10 minutes.
"I was just trying to manage my emotions during the game," MacArthur said. "I felt pretty good. I wasn't sure I was going to get back, and it was great to get back with the guys and obviously a big win.
"Everyone has seen what's been going on the past couple of years and it was great to be back playing. I was very thankful toward the organization to give me the opportunity to play again. Best day I've had in a while."
The Senators fell 5-4 in a shootout Monday in Detroit in a game they came out flat and were outshot 16-8 in the first before outshooting the Red Wings 45-33 overall.
"We had that feeling that we probably should have won that game and we brought that mindset in tonight and I think we pretty much controlled it," Karlsson said.
Despite being outshot 11-6 in the first period Tuesday, Ottawa escaped the opening period with a 1-0 lead thanks to its captain.
Karlsson carried the puck in from the blue line and just before he reached the goal line at the outer edge of the faceoff circle, he took a shot that found the tiniest of openings between Howard's shoulder and the crossbar at 12:59.
It was a different story on the shot clock in the second, but the part that matters most was the same.
Ottawa outshot the Red Wings 12-3 in the second, but another sharp-angle goal, this one from Pyatt, was the only marker of the period.
On a broken play inside the Detroit zone, Pyatt picked up a loose puck and shot from the bottom of the faceoff circle through the legs of Howard and in at 7:49, giving the Senators a 2-0 lead.
Marc Methot, Cody Ceci, Bobby Ryan, Zack Smith, Jyrki Jokipakka, Chris Neil, Chris DiDomenico and Colin White were scratches for the Ottawa Senators on Tuesday. ... Drew Miller, Anthony Mantha and Luke Glendening were the scratches for the Red Wings. ... Detroit won the previous three meetings this season with the Senators, once in regulation, once in OT and Monday in a shootout. ... Senators defenseman Dion Phaneuf played in his 900th NHL game Tuesday. ... Red Wings goaltender Jimmy Howard played in his 400th NHL game Tuesday.
Red Wings: Host Canadiens on Saturday night.
Senators: Travel to Boston to face the Bruins on Thursday night.