MIAMI -- Casey McGehee tied the game in the eighth inning with a two-out, two-run double, then drove home the winning run with a sacrifice fly in the 10th, and the Miami Marlins averted a series sweep by beating the Pittsburgh Pirates 3-2 Sunday.
Pittsburgh's Vance Worley pitched seven innings in his season debut and departed with a 2-0 lead.
But the Marlins tied the game when McGehee doubled off Tony Watson, who entered the game with a streak of 21 1-3 consecutive scoreless innings.
Leading off the 10th, Rafael Furcal fouled a ball off his leg and tumbled to the dirt in pain, but stayed in the game long enough to single. Pinch runner Ed Lucas advanced on a sacrifice, and Giancarlo Stanton was intentionally walked.
Both runners advanced on a wild pitch, and McGehee's fly to right field against Jared Hughes (3-2) scored Lucas without a play.
The Marlins earned their sixth walkoff win and broke a three-game losing streak. The Pirates had won four in a row and were bidding for their first three-game series sweep in Miami since 1993.
Miami's A.J. Ramos (4-0) loaded the bases with none out in the 10th but escaped. On a 3-2 pitch, Russell Martin grounded into a 5-2-3 double play, and Clint Barmes struck out to end the threat.
Worley was recalled from Triple-A before the game to fill in for left-hander Francisco Liriano, who went on the disabled list Wednesday with a left oblique strain. Worley allowed five hits and no walks.
Miami's Henderson Alvarez allowed two runs in seven innings.
Pittsburgh's Jared Hughes escaped a jam in the ninth, retiring two batters with a runner at second.
Pirates leadoff hitter Gregory Polanco, who has had a hit in all six games since breaking into the big leagues, had two infield singles and is batting .387. Andrew McCutchen had two hits and is batting .444 during an 11-game hitting streak.
Polanco singled in the third and scored the game's first run on Starling Marte's double. That ended Alvarez's streak of 27 consecutive scoreless innings at Marlins Park.
Josh Harrison singled home a run in the fourth to put the Pirates ahead 2-0.
Miami's rally in the eighth began when pinch hitter Jeff Baker led off with an infield single, and Rafael Furcal also singled. Reed Johnson and Giancarlo Stanton struck out, but McGehee tied the game with his third hit.
McGehee leads the majors with 30 hits with runners in scoring position, and he's batting .411 in those situations.
Notes: Marlins RHP Nathan Eovaldi went on the paternity list before the game and left for Texas to be with his wife for the delivery of their first child. He's expected to start as scheduled Wednesday against the Cubs. Miami recalled RHP Sam Dyson from Triple-A New Orleans. ... The Pirates optioned INF Michael Martinez to Triple-A Indianapolis. ... Marlins LF Christian Yelich (back) missed his second game in a row and could be headed for the disabled list, manager Mike Redmond said. ... Pittsburgh begins a three-game homestand Tuesday when RHP Brandon Cumpton (2-2, 6.06) starts against Cincinnati RHP Johnny Cueto (6-5, 1.85). ... The Marlins open a three-game series at home Monday against the Cubs when RHP Tom Koehler (5-5, 3.68) starts against RHP Jason Hammel (6-4, 2.81).