PITTSBURGH -- The Pittsburgh Pirates, heading to a record-tying 16th consecutive losing season, had reason to celebrate Saturday night.
Brandon Moss doubled with two outs in the 12th inning to score Adam LaRoche, and the Pirates rallied from a four-run deficit to beat the St. Louis Cardinals 7-6.
Manager John Russell was happy to see it.
"To see the excitement after the game, you realize the guys are still into it," Russell said.
Chris Perez (3-3), the seventh Cardinals pitcher, retired the first two batters in the 12th before walking LaRoche. Moss then lined a 3-2 pitch past Skip Schumaker in center field to score the winning run and end the 3-hour, 54-minute game.
"It feels good, especially the way I've been swinging the bat," said Moss, who went 1-for-5 and is hitting .179 (7-for-39) in September.
It was the first walk-off hit in the major leagues for the rookie outfielder, who was acquired from Boston at the trading deadline as part of the Jason Bay-Manny Ramirez deal.
Outfielder Nyjer Morgan sparked the Pittsburgh offense with three hits and two runs.
"I enjoyed it. I gave (Moss) a couple of good shots in the ribs," Morgan said, laughing. "To have everyone out there, it was a beautiful thing to see. To have everyone come together, it's fun."
Ryan Doumit had two hits and three RBI, Freddy Sanchez had two hits and two runs, and LaRoche added two RBI for the Pirates, who have scored a combined 17 runs in beating St. Louis two straight games.
The offensive outburst followed a stretch where the Pirates lost 17 of 20 games.
"Everyone is swinging the bats better," Russell said. "For us to score runs, we can't rely on just a couple of guys."
Pittsburgh also got outstanding work from its bullpen. Seven relievers limited St. Louis to five hits in eight innings. Craig Hansen (1-3) tossed a scoreless inning to pick up the win.
Felipe Lopez homered for St. Louis, which has lost four in a row.
The Cardinals, whose playoff hopes continue to fade, trail National League wild-card leader Milwaukee by five games with 14 to play.
Pittsburgh scored four times in the fifth to tie the game 6-6. Nate McLouth drove in a run with a double, Doumit hit a two-run double and LaRoche added an RBI single to chase St. Louis starter Adam Wainwright.
Wainwright, who had pitched effectively in four starts since coming off the disabled list, went four innings and allowed six runs and nine hits. He also had two singles.
The right-hander said he tired out quickly on a humid night at PNC Park.
"By the third inning, I was completely gassed," he said. "I can't explain it. I usually feel pretty good going out seven, eight, nine innings."
Pittsburgh starter Ian Snell lasted four innings and gave up five earned runs and nine hits. The right-hander threw seven shutout innings in his last appearance against St. Louis August 19.
Lopez, who has started four of the past five games at third base in place of the injured Troy Glaus, hit a two-run homer off Snell in the fourth that put St. Louis ahead 6-2. Lopez also singled in the second.
Schumaker and Aaron Miles had two hits for the Cardinals.