Updated

Marlon Byrd hit a tiebreaking solo homer in the eighth inning, and the Chicago Cubs broke a three-game losing streak by beating the Florida Marlins 7-5 on Wednesday night.

Reed Johnson hit his third career pinch-hit home run for the Cubs to make the score 5-all in the sixth. They took the lead on Byrd's second homer against Edward Mujica (4-2) leading off the eighth.

Chicago's Ryan Dempster gave up five runs in five innings, increasing his ERA to 6.91, but three relievers shut out Florida over the final four innings. Jeff Samardzija (3-0) pitched two scoreless innings, and Carlos Marmol worked 1 1-3 innings for his ninth save in 11 chances.

The Cubs overcame a 5-3 deficit, and small ball was a big part of their offense. Darwin Barney had an RBI groundout and a sacrifice fly. Tony Campana, playing in his second big-league game, pinch-ran in the eighth and scored from third on a grounder to third, barely beating the throw home with a headfirst slide.

Koyie Hill went 3 for 3 and scored three times for the Cubs, who totaled 13 hits. They've won seven of their past 10 games in Miami.

Unbeaten Ricky Nolasco took a two-run lead into the sixth for Florida but couldn't hold it. After Hill singled with two out, Johnson hit his second home run of the season. Johnson improved his lifetime average against Florida to .425 (17 for 40).

Dempster gave up his 11th homer when Hanley Ramirez connected in the first inning.

The Cubs scratched out their first run in the third. Hill led off with a single, advanced on a sacrifice, took third on a single by Kosuke Fukudome and came home on Barney's groundout.

Chicago manufactured two more runs in the fifth, with help from the Marlins' defense. Hill led off with a broken-bat double, took third on Fukudome's infield hit and scored on Barney's sacrifice fly. When Starlin Castro's single skipped past left fielder Logan Morrison for an error, Fukudome came home with an unearned run that made it 3-1.

The Marlins scored four runs, all with two out, in a span of three pitches from Dempster in the fifth. After an RBI single by Gaby Sanchez cut the Cubs' lead to 3-2, Greg Dobbs hit the next pitch for a two-run double. Mike Stanton followed with a run-scoring single on the next pitch to put Florida up 5-3.

Notes: RHP Clay Hensley (left ribs) began a rehabilitation stint, and the Marlins hope to activate him Sunday, the first day he's eligible to come off the DL. ... Ramirez began the homestand hitting .414 against left-handers and .153 against righties. ... Marmol has yet to allow a run on the road in 10 2-3 innings. ... Chicago won despite going 2 for 11 with runners in scoring position.