PITTSBURGH -- With his star player hitting only .194 with three RBI in May, Pittsburgh Pirates manager Jim Tracy found an unconventional way to get Jason Bay going.
Tracy dropped him down in the batting order.
Bay, hitting in the No. 6 spot for the first time in two years, had four RBI to lead the Pirates to a 12-9 win over the Florida Marlins in a wild game between the National League's two worst teams Friday night.
"You have a guy we wanted to move just to relax him a little," Tracy said. "But the game found him all night long. And the great thing was he responded all night long."
Bay had a bases-loaded triple and the go-ahead sacrifice fly as the Pirates won for the third time in their last five games, improving to 11-25. The Marlins (9-24) have dropped six of seven and 11 of 14.
"It's funny how it doesn't matter where you are hitting, when you are not going well, situations will find you," Bay said. "I'm a big part of the offense as far as driving in runs, so this is a big weight off my shoulders."
Craig Wilson and Jose Castillo each had three hits for the Pirates, who were down 5-0 in the first. Jeromy Burnitz and Freddy Sanchez drove in two runs apiece, and Nate McLouth scored four times.
"It obviously wasn't the cleanest game in the world, I think it's safe to say that," Tracy said. "However, I thought that we showed a lot of character."
After blowing its lead and falling behind by four, Florida rallied to tie it at nine before Bay's sacrifice fly off Todd Wellemeyer (0-2) scored McLouth for the go-ahead run in the eighth. Ronny Paulino added a two-run single.
Matt Capps (1-0) got two outs for his first major league win.
"We showed all year we're not going to lay down for anybody," Capps said. "We never lost confidence in ourselves."
Mike Gonzalez earned his fifth save with a scoreless ninth. With the bases loaded, he struck out Reggie Abercrombie and retired pinch-hitter Chris Aguila on a soft looper to second to end it.
Marlins starter Sergio Mitre threw only three pitches before leaving with right shoulder discomfort. Manager Joe Girardi said it was likely Mitre would miss a couple of starts. Jason Vargas was handed a 5-0 cushion when he entered during the Pirates' first at-bat.
Six of the Marlins' first seven batters got hits against starter Victor Santos. The first four Florida players reached base, with Miguel Cabrera's single driving in Hanley Ramirez, and Josh Willingham's double scoring Dan Uggla.
After Joe Borchard flied out, Mike Jacobs doubled off the left-center wall to score Cabrera and Willingham. Jacobs -- who had two RBIs and two runs -- scored when Miguel Olivo doubled.
"Give Victor Santos a lot of credit," Tracy said. "It was just a rugged first inning and the top of the second starts out with another base hit, but he kept us right there, and if you're going to come back in a game like that, it absolutely has to happen."
Florida had only five baserunners against Santos in his subsequent five innings.
"In the first inning, they put balls in play and got hits," he said. "I just kept going out there with the same game plan, and things turned around."
Pittsburgh got back into the game with a four-run third. Sanchez drove in the first run with a single after Vargas hit consecutive batters with pitches.
"You never expect to go in in the first," Vargas said. "I was trying to do too much and got in some bad situations."
Bay took advantage of his two-out situation when he came within inches of a grand slam but settled for a triple high off the 21-foot wall in right field to clear the bases.
The Pirates took the lead in the fourth when McLouth singled in Castillo, and Sanchez hit a sacrifice fly, giving Pittsburgh its first lead.
Two batters later, Burnitz hit a two-run single for his first RBI since May 2. Burnitz had only one hit in the 28 at-bats in between. The single -- which ultimately resulted in a double play when Wilson and Burnitz were tagged after rundowns -- gave the Pirates an 8-5 lead.
Vargas allowed eight runs -- seven earned -- and six hits in 3 1/3 innings.
"A guy's got to be prepared to pick us up," Girardi said. "When you're the long man, you've got to be ready the first pitch of the game. You might not be warmed up, but you've got to be ready to come in the game."
When the Pirates got their ninth run on Wilson's RBI single in the sixth, they appeared in control. But the Marlins had a comeback of their own.
An error by third baseman Jose Bautista allowed two runs to score in the eighth. Abercrombie made it 9-8 Pirates when he scored on a single by Ramirez, who had three hits. When Uggla singled off Capps, Wes Helms scored to tie it at nine.
But Bay's sacrifice fly was followed by Paulino's single that scored Wilson and Burnitz.
"Being down like we were and coming back like we did," Bay said, "this is a good opportunity for us to get some wins, get on a roll, get the bats going a little bit."
Ramirez extended his hitting streak to nine games. ... Cabrera became the 10th player to get 500 hits in a Florida uniform. ... The Pirates have won 10 of 11 against Florida and are 13-4 vs. the Marlins at PNC Park.