PITTSBURGH -- Jeff Karstens of the Pirates didn't need to watch Colby Rasmus' home run to know it traveled a long way. A loud noise told him so, and it wasn't a sound any major league pitcher wants to hear.
Rasmus' two-run homer in the second inning gave St. Louis' slumping offense a lift and the Cardinals avoided being swept by last-place Pittsburgh, getting a strong effort from their bullpen in a 5-1 victory Thursday night.
The Cardinals had lost five consecutive games in Pittsburgh and were in jeopardy of being swept in a three-game series for the first time since Sept. 12-14, also in PNC Park. Depleted by injuries, St. Louis had lost four of five and seven of 10.
"It was a win we really needed," Cardinals starter Mitchell Boggs said.
Rasmus' drive -- estimated at 458 feet -- was a hit the Cardinals needed after being held to three runs and 11 hits in the first two games of the series. They are missing a lot of offense with Rick Ankiel and Ryan Ludwick injured, but Rasmus gave them some with one swing.
"I didn't see where it went, I put my head down -- but I know it felt like an explosion off the bat," Karstens said.
Rasmus' shot was the 24th to bounce into the Allegheny River behind the right-field stands since PNC Park opened in 2001. Only one batter, Daryle Ward in 2002, has reached the river on the fly. Rasmus' drive was about 20 feet short of doing that.
"I wouldn't say it puts any more on me," Rasmus said of trying to pick up the offense with Ankiel and Ludwick out. "I try to do the most with every at-bat I have. ... I knew I hit it pretty good."
Boggs didn't pitch long enough to get the victory, but also aided the offense by lining a double for his first major league hit and scoring on Shane Robinson's sacrifice fly in the fifth to make it 3-1.
The inning before, Adam LaRoche tripled for the first of four consecutive hits to start the Pirates' fourth, but Boggs managed to give up only one run. Rookie catcher Robinzon Diaz was thrown out trying to move from first to third on Eric Hinske's single and Jack Wilson hit into a double play.
"He [Diaz] had the right idea, but you have to pick up the third-base coach in that situation, when the ball is behind you," Pirates manager John Russell said. "He's a young player trying to make something happen, and he made a mistake."
Boggs was lifted after the Pirates loaded the bases with one out in the fifth. Trever Miller (1-0) retired LaRoche on a popup and Diaz on a flyball.
"Whew, there was all kind of trouble there," manager Tony La Russa said. "That was a huge escape for us. Everybody that pitched did something special. The relievers were outstanding."
Miller, Kyle McClellan, Dennys Reyes, Chris Perez and Ryan Franklin combined to shut out the Pirates on three hits after Boggs was lifted.
Albert Pujols added a two-run single for St. Louis in the eighth.
Leadoff hitter Nyjer Morgan reached base four times and No. 2 hitter Freddy Sanchez had three of Pittsburgh's 12 hits, but the Pirates stranded 10 runners, hit into three double plays and ran themselves out of a possible big inning when Diaz was easily thrown out by right fielder Robinson.
The Pirates lost their ninth in 11 games and 13th in 16 games.
Karstens (1-2) gave up three runs and seven hits over six innings in his first career start against St. Louis. The Cardinals had 10 hits against four Pirates pitchers, only one fewer than they had in the first two games combined.
Rasmus' home run was his second and followed Yadier Molina's one-out single. ... St. Louis has homered in nine consecutive games. ... Pirates 3B Andy LaRoche wasn't in the lineup after starting 26 consecutive games. ... Pirates Gold Glove CF Nate McLouth made an excellent sliding catch of Chris Duncan's sinking liner to end the third.