SAN FRANCISCO (AP) — Colby Rasmus homered to lead off the seventh inning to help Scott Feldman earn his first win in more than two months, and the Houston Astros held on to beat the San Francisco Giants 2-0 on Wednesday.

Jed Lowrie also homered for the Astros, who stumble back to Minute Maid Park with a slimmer AL West division lead after going 2-7 on their nine-game road trip.

Feldman (5-5) missed 45 games earlier this season with a torn meniscus and had been winless in four starts since coming off the disabled list in July. He combined with four relievers on the five-hit shutout.

The Astros right-hander — winless since May 26 — gave up four hits over six innings, walked one and struck out four while allowing only one runner past second base.

Luke Gregerson pitched the ninth for his 23rd save.

The slumping Astros needed it on a day they managed only five hits.

Giants starter Chris Heston (11-7) allowed one run and over 6 1-3 innings. The San Francisco rookie struck out four and matched his season high with four walks while losing consecutive starts for the first time.

Rasmus ended the pitcher's duel with his 15th home run of the season, a solo shot that bounced into McCovey Cove over the right field wall.

Lowrie homered with two outs in the eighth off George Kontos.

Feldman retired 12 of 14 during one stretch, getting help from shortstop Carlos Correa, who made a running, bobbling catch on Nori Aoki's high fly to short center.

TRAINER'S ROOM

Astros: OF Carlos Gomez was held out of the game after injuring his right knee while colliding with the fence in the first inning of Tuesday's loss. Gomez flew out as a pinch hitter in the seventh.

Giants: Aoki was back in the lineup after getting hit in the head by a pitch from the Cubs' Jake Arrieta on Sunday. Aoki went 0 for 4. . RHP Mike Leake is eligible to come off the disabled list Aug. 18. He's expected to be activated and slide back into the rotation.

UP NEXT

Astros: LHP Dallas Keuchel (13-6) pitches against Detroit on Friday when Houston begins a 10-game homestand. Keuchel was beaten in his previous outing and has not lost consecutive starts this season.

Giants: RHP Ryan Vogelsong (7-8) makes his second start in place of Leake when the Giants begin a four-game series at home against Washington on Thursday.