SAN FRANCISCO -- For one night, the defending World Series champion Giants put together a fine pitching performance, played solid defense and scored just enough to get it done.
Miguel Tejada made several pretty stops playing for Pablo Sandoval at third base, including one on which reserve first baseman Mark DeRosa scooped up the low throw to save a run and end the third inning.
"A 10," the little-used DeRosa said jokingly in ranking his defensive gem. "Out of position, wet grass, men in scoring position -- that's a 10."
Bumgarner (8-12) hung tough as he waited for his team to finally give him some support, outpitching J.A. Happ (4-15), who lost his fourth straight start a day after being recalled from Triple-A.
San Francisco stayed three games behind first-place Arizona in the NL West after the Diamondbacks beat San Diego 5-0 in the desert.
Keppinger fell behind 0-2 before delivering the big hit. One of San Francisco's downfalls has been not taking advantage with runners in scoring position.
"It's big considering the pitching performance we got," Keppinger said. "Goodness, at this point we just needed one so we could tie it up and at least extend the game and keep on going. Fortunately the ball found the gap and we got two."
The Giants bounced back after dropping the opener of the four-game series 3-1 on Thursday night -- their third loss in four meetings with the Astros over the last week.
It sure felt like an October night at sold-out AT&T Park: cool, with a dense fog hovering over center field. Whether the defending World Series champion Giants play in October this year remains to be seen.
The reeling, stumbling Giants won for just the ninth time in their last 27 games and fourth in 11.
San Francisco has played six straight games decided by two or fewer runs, and nine of 11. Keppinger's two RBIs gave him five since he joined the Giants in a July 19 trade from Houston that sent Thursday night winning pitcher Henry Sosa to the Astros.
"He does a good job swinging the bat," Astros manager Brad Mills said of Keppinger. "He's a professional hitter. He battled and finally got a pitch he could hit."
Manager Bruce Bochy switched up his lineup, sitting the slumping Aubrey Huff and resting an ailing Pablo Sandoval. Bochy wouldn't say whether Huff -- batting .083 (1 for 12) on the homestand -- would stay out of the starting lineup for multiple games.
DeRosa played first base most of the night in his place, while Brandon Belt remained in left field.
"We're mixing it up to see if we can't put a spark in the lineup, ignite it, get it going," Bochy said. "We've had our struggles all year with it. It's been ongoing. It'd be nice to come out of it this last month, which they're capable of doing."
Huff was booed when he hit a high popup for a quick out in his first at-bat of the night in the seventh. Bochy planned to go back to his regular lineup Saturday night.
Bumgarner got into trouble in the seventh after hitting leadoff batter Matt Downs, then allowing Jose Altuve's single. Moments after a mound visit from pitching coach Dave Righetti, catcher Chris Stewart tried to pick off a wandering Downs at second but threw wildly into center field as both runners advanced on the error.
"He saved us," Bochy said.
With injured All-Star closer Brian Wilson watching from the top step of the dugout, Santiago Casilla struck out the final two batters looking to finish a perfect ninth for his second save in three chances.
Happ lasted six innings in his first big league outing since Aug. 5 after getting promoted from Triple-A Oklahoma City on Thursday. He was 1-0 with a 1.50 ERA in three starts and worked seven shutout innings with one hit his last time out for the RedHawks.
"I came back with a little different mindset and a little tweaking of mechanics," he said. "I have more conviction out there."
Mills gave third baseman Jimmy Paredes the night off so Downs could get some at-bats.
Cody Ross grounded into an inning-ending double play in the third, the Giants' 100th this year. ... The Giants will purchase the contract of lefty Eric Surkamp from Double-A Richmond to pitch Saturday in his major league debut. The 6-foot-4, 190-pound Surkamp is pitching in place of the injured Jonathan Sanchez, sidelined with a sprained ankle. Surkamp is 10-4 with a 2.02 ERA and 165 strikeouts in 23 appearances and 22 starts this season for the Flying Squirrels. "He's got a fierce demeanor," Belt said. "He goes right after you. He gets a lot of strikeouts with his curveball. That thing is nasty." ... RHP Brett Myers (3-13) pitches for the Astros on Saturday trying to snap a career-long, seven-game losing streak over his last 11 starts.