Despite allowing five runs and seven hits in 6 1-3 innings, Halladay (10-7) improved to 4-0 in his last five starts. The right-hander walked three and struck out six.
Juan Pierre and Chase Utley both had three hits for Philadelphia, which finished with 15 hits while winning its 14th in the last 18 games. The five-time defending NL East champion Phillies, who reached .500 for the first time since June 4, are making a late playoff push. They began the day five games behind St. Louis in the NL wild-card race.
Giancarlo Stanton homered for Miami, which has lost nine of 13. Stanton went deep for the 14th time in his last 17 road games to up his league-leading road total to 21 homers.
Jonathan Papelbon pitched a scoreless ninth for his 33rd save in 37 chances. He was the last of 12 pitchers used in the game, with each team sending six to the mound.
The Phillies jumped in front 3-0 in the first inning, highlighted by RBI singles from Carlos Ruiz and Domonic Brown.
Miami closed within 3-2 in the third on an RBI single by Justin Ruggiano and sacrifice fly by Jose Reyes
Philadelphia got a run back in the bottom of the frame on Utley's RBI single, and then took a 5-2 lead in the fifth on Pierre's RBI single off Nathan Eovaldi (4-12), who gave up five runs and eight hits in four-plus innings.
Stanton launched Halladay's first pitch of the sixth inning deep into the seats in left to bring the Marlins within 5-3. It was Stanton's 34th homer, tying his career-high set last season.
Halladay got that run back himself in the bottom of the frame, lining a single up the middle off Chris Hatcher to drive in Michael Martinez who had doubled. It was the second RBI of the season for the light-hitting Halladay, who entered batting .152.
And Rollins followed by blasting a two-run homer to right to put Philadelphia ahead 8-3. Rollins shouldn't have gotten the chance, as Marlins catcher Rob Brantly dropped a routine foul pop and was charged an error on the pitch before the homer.
That looked to be plenty of runs for the Phillies, but the Marlins scored four runs against four Philadelphia pitchers in the seventh.
Halladay departed after facing three batters, culminating when Bryan Petersen doubled home Brantly. After giving up an RBI single to Justin Ruggiano, it looked as if reliever Josh Lindblom was going to end the inning but second baseman Utley had a sure double-play grounder go through his legs to extend the inning. The Marlins scored two more on RBI singles by Carlos Lee and Greg Dobbs, to get within 8-7.
Rollins' sacrifice fly in the bottom of the seventh scored John Mayberry Jr., who had doubled, and put Philadelphia ahead 9-7. The Phillies left the bases loaded when Ryan Howard flied out to center for the final out.
Notes: Ruiz, having a career year, was back in the starting lineup for the first time since Aug. 2. He was on the DL from Aug. 3 through last Friday with a left foot injury. . Christopher Suprun, a paramedic and firefighter who was a first responder to the 9/11 attacks of the Pentagon, threw out the first pitch. Suprun was one of many military, fire and police personnel recognized by the Phillies on the evening. . Dobbs went 1 for 3 against Halladay and is batting .533 (8 for 15) against Halladay. . Miami RHP Josh Johnson (8-11, 3.81) is scheduled to face Phillies LHP Cliff Lee (4-7, 3.50) is the finale of the three-game set at 4:05 Wednesday.