MIAMI - An improbable hero for a surprising team, Ramon Castro put the Marlins ahead in the wild-card race Tuesday night.
The third-string catcher hit a two-out home run in the 13th to cap a seesaw marathon, and Florida beat the Los Angeles Dodgers 5-4.
The Marlins came from behind three times to win and moved a half-game ahead of Philadelphia.
"It feels great," manager Jack McKeon said. "When you have nights like this, you feel very good."
Los Angeles fell 31/2 games behind the Marlins and lost to them for the first time in five meetings this season.
"It's a disappointing game to have to lose, but it was a hell of a game," manager Jim Tracy said. "It was a game with two clubs who obviously know what's at stake."
Castro, the Marlins' third catcher of the game, hit his third homer in his 41st at-bat.
"I'm happy I had a chance to win the game," he said. "This team is for each other 100 percent. Everybody was clapping for me, and I'm happy for that too."
His homer came on Paul Shuey's 2-and-0 split-finger.
"This stings as bad as any one I've ever had," Shuey said. "I hung it, and he hit it."
Florida overcame three plays at the plate that went the Dodgers' way, including a call that led to catcher Ivan Rodriguez's third ejection in two weeks.
Chad Fox, recalled Tuesday from Triple-A Albuquerque, earned the victory. He retired Alex Cora and Cesar Izturis with a runner on third in the 13th.
The Florida bullpen retired 16 Dodgers in a row during six hitless innings.
Rodriguez was ejected when he protested a call at the plate in the fifth that gave the Dodgers a 4-3 lead.
Paul Lo Duca scored from first on Shawn Green's double. Shortstop Alex Gonzalez's relay home beat the runner and Rodriguez blocked the plate and made the tag, but umpire Hunter Wendelstedt ruled Lo Duca safe.
"I saw him juggle the ball," Lo Duca said. "I think that's what Hunter saw."
TV replays appeared to show the runner was out. Rodriguez threw his mask, screamed a profanity and was ejected.
Florida tied it at 4 in the bottom half on singles by Luis Castillo and Rodriguez's replacement, Mike Redmond, and a double by Juan Encarnacion.
CUBS 3, ASTROS 0: Carlos Zambrano held Houston to five hits to win his fifth straight start, getting his first major-league shutout for host Chicago.
Houston's lead in the Central was reduced to one over St. Louis, which beat the Pirates 10-6, and 21/2 over the Cubs.
Alex Gonzalez, benched for two days and in a 2-for-46 slump that had driven his average down to .224, hit a two-run homer in the first off Tim Redding.
PADRES 14, BRAVES 4: San Diego pounded Greg Maddux for 13 hits in five innings and went on to tie a franchise record with 24 hits, routing host Atlanta.
The East-leading Braves matched a season high with their third straight loss. San Diego tied the team record for hits set April 19, 1982, vs. the Giants.
The Padres' season high was 16 hits. It was the most hits against the Braves since Baltimore had 25 on June 13, 2000.
METS 5, GIANTS 4: Barry Bonds homered twice, giving 650 in his career, but host New York overcame his power display.
Bonds leads the majors with 37 home runs. His drive in the ninth moved him within 10 of Willie Mays for third on the all-time list.
The Mets used a three-run second against Sidney Ponson to jump-start their third victory in five meetings with the West leaders this season.
D'BACKS 2, REDS 0: Curt Schilling struck out 11 and Steve Finley homered as Arizona beat Cincinnati for the 15th straight time.
The Diamondbacks opened a seven-game road trip with their third consecutive victory and sixth in seven games. Their 15-game winning streak against the Reds is the longest current string by any team against another.
BREWERS 6, PHILLIES 3: Keith Osik hit a bases-clearing double and Keith Ginter added a two-run double, leading visiting Milwaukee. Wayne Franklin allowed three runs and four hits in 62/3 innings to snap a three-game losing streak.
ROCKIES 6, EXPOS 3 (11): Pinch-hitter Greg Norton came through with a three-run homer in the 11th as Colorado ended a three-game skid. With Montreal trailing 3-1 after the Rockies scored twice in the sixth, Vladimir Guerrero hit a two-run shot off Chin-hui Tsao in the bottom half.