The Cubs, who began the evening with a half-game lead over St. Louis in the National League Central, had won their previous two games.
Chicago rallied from a 2-0 deficit in the seventh when Jake Fox hit a two-run homer but the Marlins came back in the eighth to break open the contest.
Carlos Marmol (2-2), the fourth Chicago pitcher, walked Jorge Cantu and Dan Uggla to start the eighth. Cantu was out at third on a fielder's choice grounder by Jeremy Hermida and Cody Ross flew out to left, giving the Cubs a good chance to escape the trouble.
Baker, however, singled in Uggla to give the Marlins the lead and, after Ross Gload was hit by a pitch to load the bases, Wes Helms delivered a two-run double.
Brendan Donnelly (1-0) got the win in his 12th relief appearance of the year. He retired the last two batters in the eighth, and Leo Nunez worked around a ninth-inning walk to collect his ninth save.
Copyright 2009 by United Press International.