Bumgarner (8-4) carried a two-hitter into the seventh and then allowed three hits to the first four batters he faced in the frame, including Rupp's shot over wall in center. The left-hander struck out seven and walked one.
Bumgarner allowed more than two earned runs in a game for the first time since giving up four to the Dodgers on April 15, a span of 12 starts.
Jeremy Hellickson (5-6) ended a personal four-game losing streak, winning for the first time since May 18. He gave up two runs, one earned, and five hits in six innings.
Jeanmar Gomez pitched the ninth for his 20th save in 22 chances.
The Giants had beaten the Phillies in 13 of their previous 16 meetings. They fell to 18-9 in one-run games.
San Francisco got to Hellickson for one in the second and the third. Buster Posey scampered home when Gregor Blanco reached on first baseman Joseph's error, and then Posey added a sacrifice fly in the third.
Phillies: RHP Vince Velasquez will start Monday's game at Arizona. He has been on the disabled list with a right biceps strain since June 9.
Giants: RHP Sergio Romo (right flexor sprain) will pitch in a rehab assignment for Single-A San Jose on Sunday. A decision on his future is expected afterward.
Phillies: RHP Aaron Nola takes the mound for Sunday's series finale. He has lost three straight and has a 15.22 ERA over that stretch, a span of 9 2/3 innings. He is making his first appearance against the Giants.
Giants: RHP Johnny Cueto has a career-high eight-game winning streak entering his start on Sunday. The Giants have won 13 of his 15 starts. Cueto is 1-4 with a 5.05 ERA against the Phillies in nine career starts.