Giants 6, Phillies 5 (10): Melky Cabrera homered to tie the contest in the eighth inning and scored the winning run on Gregor Blanco's bunt single in the 10th as visiting San Francisco posted its seventh win in eight outings.
Buster Posey, who homered and drove in three runs, collected his fourth hit with a single to shallow right to put runners on the corners in the 10th. Two batters later, Blanco helped the Giants improve to 7-1 in extra-inning games with a safety squeeze against Jonathan Papelbon (2-4).
Matt Cain belted his sixth career homer for the Giants, who maintained their 2 1/2-game lead over the Los Angeles Dodgers in the National League West. By doing so, they handed the Phillies their third straight loss after a four-game winning streak.
Although the contest was billed as a pitchers' duel, Cain and fellow All-Star Cole Hamels allowed three homers and five runs apiece before departing without a decision.
Sergio Romo (3-1) retired both batters he faced to pick up the win. Santiago Casilla retired the side in the 10th for his 24th save.
Ryan Howard went deep for the second straight game with a three-run shot and Hamels belted his first career homer. Chase Utley added a solo shot and Shane Victorino collected his 1,000th career hit with a single in the sixth inning for the Phillies, who have dropped seven straight at Citizens Bank Park to fall to a National League-worst 17-29 at home.
With the Giants nursing a 4-2 lead in the sixth, Victorino put runners on first and second base to set the stage for Howard. The slugger jumped on a high fastball from Cain and launched it into the seats in right field.
GAME NOTEBOOK: Giants 1B Aubrey Huff's MRI revealed patella tendinitis in his right knee. He will be re-evaluated on Monday. ... Hamels tossed a career-high 128 pitches. ... The announced attendance was 45,989, marking the largest regular-season crowd in the history of Citizens Bank Park.