The Cardinals ended a five-game losing streak that dramatically reduced their hopes for a division title. They moved back within seven games of the Reds for the top spot in the National League Central.
Despite their deficit in the division race, the Cardinals have defeated the Reds in each of their last five meetings.
St. Louis was holding its 3-2 lead in the seventh when Boggs relieved starter Jaime Garcia with a runner on second and two away. Boggs struck out Drew Stubbs to end the threat.
McClellan came on in the eighth and issued two one-out walks. He then got Jonny Gomes on a liner to right and Ryan Hanigan on a fielder's choice grounder. Ryan Franklin pitched a perfect ninth for his 23rd save.
Jon Jay tripled in a St. Louis run in the first and then scored on a sacrifice fly by Albert Pujols.
A groundout by Skip Schumaker brought home Brendan Ryan in the second with what turned out to be the winning run.
Garcia (13-6) gave up two runs on six hits in 6 2/3 innings. Bronson Arroyo (14-9) surrendered three runs on six hits in six innings to take the loss.