Lidge entered to start the ninth with a 6-5 lead and promptly gave up a double to Ross Gload, who advanced to third on Chris Coghlan's fly out. Lidge struck out pinch-hitter John Baker before walking Hanley Ramirez. Cantu then lined a single to left-center to score Gload and make it 6-all.
Carroll fell behind 0-2 before singling to center to score Ramirez.
Dan Meyer (3-1) pitched an inning of scoreless relief for the win in the soggy game.
A 45-minute delay in the middle of the eighth inning significantly thinned the announced crowd of 31,042. Florida has drawn more than that just seven times this season.
Ryan Howard doubled, homered and drove in four runs for the Phillies, whose magic number to clinch the NL East remained five. The Phillies went ahead 6-3 in the seventh on Howard's two-run homer but pinch-hitter Gaby Sanchez homered off Cole Hamels in the bottom half and Cody Ross had a two-out RBI single in the eighth to make it 6-5.
Hamels gave up four runs and eight hits in seven innings. He struck out four and hit a batter.
Raul Ibanez's solo homer tied it at 3 with one out in the sixth. Ibanez sent an 0-2 pitch into the right-center field seats for his 33rd home run.
Pedro Feliz followed with a hard double down the left-field line. After Paul Bako flied out, Hamels singled hard past second baseman Dan Uggla to score Feliz with the go-ahead run.
In the seventh, Chase Utley walked off reliever Renyel Pinto with one out. Howard then homered to left to give Philadelphia a 6-3 lead. It was Howard's 42nd home run.
Florida took a 3-2 lead in the fifth.
Ross led off with his 24th home run. Ronny Paulino followed with a double to right-center and took third on starter Rick VandenHurk's sacrifice. Coghlan followed with a softly lined run-scoring single to left.
Cantu's RBI single pulled Florida to 2-1 in the fourth. Cameron Maybin opened with a double and took third on Ramirez's ground out. Cantu then lined a single to right to score Maybin.
Howard's two-out, two-run double in the third gave Philadelphia 2-0 lead.
VandenHurk allowed four runs and seven hits in six innings. He walked one, struck out five and hit two batters.
Notes: Ibanez has hit six HRs in last 17 games after hitting one homer in the previous 34 games. ... Jimmy Rollins' third-inning double tied Bobby Abreu for fifth place (585) on the team's all-time extra-base hits list. ... Sanchez's home run was Florida's eighth by a pinch-hitter this season to tie the team record set in 1999. ... Marlins manager Fredi Gonzalez was ejected for arguing after pinch hitter John Baker was called out on strikes for the second out in the ninth. It was Gonzalez's fourth ejection of the season.