Buehrle (10-11) snapped a personal three-decision losing streak by giving up five hits and two runs over seven innings. He walked one and struck out three.
Greg Dobbs had three hits, including a home run that broke a 2-2 tie in the sixth inning. He singled in a run and Donovan Solano added a sacrifice fly in the fourth when the Marlins grabbed a 2-0 lead.
The Phillies had shut Miami out the first two games of the series.
Those three runs were all Phillies starter Roy Halladay (6-7) allowed. He gave up six hits while walking one and striking out seven.
Philadelphia pulled back to 2-2 with runs in the fifth and sixth. Ty Wigginton hit a home run in the fifth and had an RBI single the following inning.
But Dobbs connected for his fourth home run of the season in the bottom of the inning for what proved to be the winning run.
Miami put the game away with a six-run eighth. Austin Kearns and Bryan Petersen delivered back-to-back hit that each drove in two runs.
2014: NFL Cheerleaders [PHOTOS]
Michael Sam cut from the Dallas Cowboys