SAN FRANCISCO (CBS / AP) — Madison Bumgarner shut down Milwaukee for seven innings and added an RBI double to win his eighth straight home start, helping the San Francisco Giants snap a four-game losing streak with a 5-2 victory over the Brewers on Saturday.

Buster Posey and Brett Pill added RBI hits in a three-run sixth inning against Randy Wolf to give Bumgarner (5-1) all the support he needed as the Giants ended a season-worst losing streak.

READ MORE: 4 San Jose Double Homicide Suspects Arrested; Drugs, Weapons Seized

The Brewers got NL MVP Ryan Braun back in the lineup after he missed Friday’s series opener with a sore right Achilles and he hit a solo homer in the eighth inning. But Milwaukee lost shortstop Alex Gonzalez to an injured right knee earlier in the game in the latest stroke of bad luck to hit the team this week.

The Giants had not led a game at any point during their recent skid and struggled early against Wolf (2-3), putting just one runner in scoring position in the first four innings.

Bumgarner finally helped them break through in the fifth inning after Hector Sanchez led off the inning with a double. Bumgarner then tied the game at 1 when he lined a one-out double into the left-field corner.

San Francisco broke it open with three runs in the sixth. Melky Cabrera started the rally by tripling for the second straight day and Posey followed with a single through a drawn-in infield. Pill then doubled into right-center with Posey scoring when Norichika Aoki took a bad angle on the ball. Pill later scored on Conor Gillaspie’s groundout to make it 4-1.

READ MORE: Police Arrest Suspect in Tenderloin Stabbing Incident

Bumgarner left after a scoreless seventh, allowing one run and six hits to lower his home ERA to 1.00 during his current winning streak. Guillermo Mota allowed Braun’s eighth homer in the eighth before Sanchez added an RBI double in the bottom half for San Francisco.

Santiago Casilla closed for his fifth save in as many chances.

The Brewers have had a stretch of injuries this week, starting on Tuesday in San Diego when they lost first baseman Mat Gamel to a torn ACL in his right knee. Braun left early the next day and missed Friday’s series opener against the Giants. Outfielder Carlos Gomez went down in that game with a strained left hamstring and was likely headed to the disabled list.

Gonzalez drove in Aramis Ramirez with the first run of the game on an RBI single off Bumgarner but got hurt later in the second when he stole second base. Gonzalez’s leg buckled as he slid into second and he immediately called for a trainer. He was helped off the field and went for an MRI.

After the Giants tied the game in the fifth inning, the Brewers missed a golden chance to regain the lead in the sixth. Ramirez reached on a two-base error by center fielder Angel Pagan to lead off the inning. No. 5 hitter Corey Hart sacrificed Ramirez to third base, but Cesar Izturis and Brooks Conrad followed with shallow fly balls to right field, keeping the score tied at 1.

MORE NEWS: Update: 3 Injured In San Jose Stabbing; Suspect Fatally Struck By Truck On Highway 85

Notes: A female fan ran across the entire outfield in the ninth inning before being apprehended by security after she jumped back into the stands in right field. … Brewers manager Ron Roenicke said the team will likely call someone up from the minors to take Gomez’s place Sunday. … Pagan reached on an infield single in the third to extend his hitting streak to 19 games. … Matt Cain looks to snap a two-game losing streak when he starts the series finale for San Francisco against Shawn Marcum.