SAN FRANCISCO -- Eric Surkamp said his legs were numb when he almost threw one of his first pitches to the backstop. He could laugh it off because he regrouped and pitched effectively in his major league debut.
"That was amazing," said Surkamp, who found out he was making the start late Thursday night. "When my name was announced and the fans cheered, it sent chills down my back. To have that kind of support was amazing."
Mark DeRosa, in as part of a double switch, singled with one out and then stole his first base in two years to set up the game-winner.
"That's not his forte but he had a good jump," Giants manager Bruce Bochy said. "Mark has been through a lot and now he's getting a chance to play a little bit. He got the big hit and scored the winning run."
Jeremy Affeldt (3-2) got the final two outs of the 10th to earn the win as the Giants were able to keep pace with the Arizona Diamondbacks, who beat the San Diego Padres to stay three games up in the NL West race.
Fernando Rodriguez (2-3) took the loss for the Astros, who reached 90 losses the quickest in franchise history.
"He's a good hitter and I had thrown everything at him the last few times I faced him," Rodriguez said of Keppinger. "I hit my spot and he was able to flick it out there. He's one of those guys you have to battle and hope he makes a mistake."
Carlos Beltran had two hits and drove in a run for the Giants, who have won two straight at home for the first time in over a month.
Carlos Lee had three hits and drove in a run for the Astros, who have lost six of seven.
Surkamp was called up from Double-A Richmond to make the start. A control pitcher, he walked the first batter he faced and three in the first three innings. Surkamp allowed one run and six hits. He walked three and struck out four.
"The first couple of innings I was rushing too much," Surkamp said. "I was able to get out of a couple of jams and settled in."
Houston starter Brett Myers, who has not won since June 17, matched season lows for runs (1) and hits (2) in his seven innings. He walked three and struck out seven. Myers is 0-7 over his last 13 starts.
Mike Fontenot doubled to lead off the first and scored when Beltran grounded out to first.
Myers retired 12 of the next 13 hitters and finished strong, striking out two of the last three batters he faced.
"He was absolutely outstanding," Astros manager Brad Mills said. "That was one of his best outings."
Fontenot was the only Giants player to venture any further than second base until the 10th.
The Astros were 1 for 11 with runners in scoring position, with Lee's double driving in the tying run in the fifth. Houston stranded 10 runners.
OF Nate Schierholtz was placed on the 15-day DL to make room for Surkamp. ... Astros IF Jose Altuve led off for the fourth time because Mills wanted OF Jason Bourgeois to hit second. ... Mills does not want to put one of his pitchers in a position to lose 20 games. "Hopefully that's not an issue," he said. "That wouldn't be too cool. We have other issues." ... Astros RHP Bud Norris, a native of nearby Novato and a Giants fan growing up, will make his first career appearance at AT&T Park on Sunday. Norris is 2-2 over his last 10 starts. He's 11th in the NL with 151 strikeouts and seventh in strikeouts per nine innings. ... The Giants will send RHP Matt Cain to the mound on Sunday. He's 1-3 in seven appearances, six starts, against the Astros and allowed seven runs and nine hits in 2 2/3 innings in his last start against them. ... Giants RHP Brian Wilson played catch for the third straight day, reporting some improvement in his right elbow. ... Giants IF Pablo Sandoval was replaced by a pinch-hitter for the first time this season. ... DeRosa last stole a base on June 25, 2009.