Alex Chiasson and Filip Zadina scored, and Magnus Hellberg made 20 saves for the Red Wings (31-30-9), who lost 5-2 to the Florida Panthers on Monday and are 3-9-1 in their past 13 games.
Detroit, which has a game in hand, moved within eight points of Florida for the second wild card into the Stanley Cup Playoffs from the Eastern Conference. The Panthers lost 6-3 at the Philadelphia Flyers on Tuesday.
"It's been a tough stretch of late," Detroit coach Derek Lalonde said. "We've talked about having something to play for a little bit, where our morale was, and I give the guys a ton of credit, they played with some urgency tonight."
Robert Bortuzzo and Marco Scandella scored, and Joel Hofer made 28 saves for the Blues (31-33-6), who won their previous two games.
"Second period was careless, not a good period," St. Louis coach Craig Berube said. "Third period was better. We were just careless in the second, didn't skate. The first period I thought we did a good job of controlling things, cycle game, things like that. They played last night. The goal was to wear them down over time, but we didn't do that in the second.
"Execution wasn't good, just had no composure tonight with it, didn't see it. Power play, didn't see the plays on the power play tonight (0-for-3). We weren't seeing a lot."