MIAMI (AP) -- The game brought to mind a Saturday beer league, with plenty of swinging from the heels by both the Florida Marlins and Philadelphia Phillies. Despite a four-run margin, the outcome was in doubt until the final pitch.
The Marlins had a little more pop, hitting three homers to win 9-5 and tighten the race in the NL East.
"It does resemble a softball game a little bit," said Cody Ross, who came within a homer of the cycle. "We've got some guys going up there taking healthy hacks, and the Phillies are the same way. The game is never over."
Trailing by four runs, Philadelphia loaded the bases with one out in the ninth against Kevin Gregg. Ryan Howard, who leads the majors with 29 home runs, then struck out on three pitches. Pat Burrell, who homered twice earlier, grounded out to end the game.
"I was trying to get everybody on the edge of their seats," Gregg said with a smile. "What counts is we shook hands afterward."
The game was filled with misadventures. Three runners were thrown out at the plate, two catchable balls dropped in right field, and Marlins third baseman Jorge Cantu committed two errors on one grounder.
But mostly it came down to the long ball, and even against high-scoring Philadelphia, the Marlins can hold their own. Florida leads the majors with 138 homers, and the Phillies are second with 136.
"If they want to mash, we can mash," Ross said.
Dan Uggla hit a two-run homer for Florida, his 24th, and Jeremy Hermida hit his 11th. The Marlins even got a homer from rookie backup catcher John Baker, who drove in four runs to triple his season RBI total to six since being recalled from the minors July 8.
"This lineup is really strong," Baker said. "It's a fun lineup to hit in. I'm just trying to chip in where I can."
The Marlins remained third in the NL East but are only 1 1/2 games behind Philadelphia, which began the day with a one-game lead over the New York Mets.
And Florida fans -- last in the majors in attendance -- are beginning to catch pennant fever. Attendance was 26,520, giving the Marlins home crowds above 20,000 in consecutive games for the first time this season.
"That tells you we're doing good," said Cantu, who made up for his errors by going 4-for-5 with three RBIs.
Ross went 3-for-5 with a single, double and triple. Needing a homer to complete the first cycle by a Florida player, he struck out on three pitches in the seventh and grounded out in the eighth.
Baker singled in a run and hit a three-run homer, his second.
Burrell hit two solo homers for Philadelphia, giving him 25 this year. He has 243 career homers, which ties him with Chuck Klein for third on the Phillies' all-time list.
But after the game, Burrell was focused on making the final out.
"I'm still bummed about that last at-bat," he said. "We had a chance to win there. That's the part that hurts. It stings."
The Marlins' homers came off Kyle Kendrick (8-4), who allowed 10 hits and seven runs in 4 1/3 innings.
"They swing early and often a lot," Kendrick said. "Obviously they wanted the fastballs, so I tried to mix it up. I just didn't have my stuff today."
Scott Olsen (6-4) allowed four runs, three earned, in five innings. Four relievers limited Philadelphia to one run over the final four innings.
The Marlins flirted with disaster in the second. Cantu committed two errors by bobbling a grounder and making an errant throw, and Olsen gave up two hits and walked the pitcher to load the bases.
The Phillies came from behind twice before Florida went ahead to stay in the fifth, scoring three runs on the homers by Hermida and Uggla to lead 7-4.
"The Marlins are aggressive," Phils manager Charlie Manuel said. "They hunt fastballs to hit. And when you make a mistake, they hit it."
The Phillies fell to 12-18 in day games. ... When introducing the Marlins' lineup on network TV before the game, Florida OF Luis Gonzalez identified Olsen as "the man known to take a jolt of electricity." Olsen allegedly fought with police and was shocked with a Taser in an incident last year. He enrolled in a pretrial diversion program, which led to the dismissal of charges.