Winn also singled in the eighth and scored a run after two wild throws by the Astros on the same play.
Astros ace Roy Oswalt and Giants rookie Tim Lincecum put on an impressive duel through the first seven innings, but neither figured in the decision. Oswalt had a no-hitter through 5 2/3 innings, while the 22-year-old Lincecum struck out 10 in his third career start.
"Both teams battled and he (Oswalt) did really well," Lincecum said. "I'm just glad we won. Pretty much my whole deal is just trying to keep our team in it."
"We finally got a break," Giants manager Bruce Bochy said. "That's what we needed. We hit a couple of balls decent earlier and just couldn't get a break, and it finally happened."
Barry Bonds went 0-for-3 with two walks and stayed stuck on 745 career homers, 10 shy of Hank Aaron's career record. Bonds is 2-for-17 on the Giants' road trip and hasn't homered in seven games, his longest drought of the season.
Brad Lidge (2-1), demoted from the Astros' closer role earlier this season, hadn't allowed an earned run in 12 of his past 13 appearances. He relieved Dan Wheeler in the 12th and gave up a leadoff single to Feliz, who went 2-for-5. Omar Vizquel got Feliz to second with a sacrifice bunt and Rich Aurilia advanced him to third with a broken-bat groundout.
Winn, batting .323 with runners in scoring position, then hit a 3-2 pitch down the first-base line. Lance Berkman was in position to field it, but the ball caromed off first base. Second baseman Craig Biggio picked it up and flipped to Lidge, but Winn beat the toss and Feliz scored.
"I honestly thought it was going to be foul when I hit it," Winn said. "Somehow, it stayed fair and somehow it hit the base. It was good on both parts."
The Giants won for just the third time in nine games, while the Astros had a four-game winning streak snapped.
"It was kind of a quirky deal," Berkman said of the decisive play. "Brad didn't give up a hard-hit ball that inning. Somehow, he got a bad bounce there at the end and that was it."
The Astros led 1-0 after Carlos Lee's sacrifice fly scored Berkman in the fourth. Otherwise, neither team could do much.
Oswalt walked Fred Lewis with one out in the first, then retired the next nine batters, including Bonds on a pop out in the second inning. Bonds was 4-for-4 with four walks against Oswalt coming in.
Lincecum, called up on May 9, allowed only Berkman's first-inning single through the first three inning.
Oswalt was impressed. At one point, the 29-year-old ace joked to one of the umpires that "it's good to be young."
"Looked like he's got a good arm," Oswalt said. "He throws a lot of strikes and attacks the strike zone. Looks like he's got some good stuff. I like the way he competes."
Berkman walked with one out in the fourth, stole second and went to third when catcher Bengie Molina's throw to second baseman Ray Durham sailed into center field. Berkman went to third on Molina's error and scored on Lee's sacrifice fly. Lee has 38 RBI and leads the NL with six sacrifice flies.
Vizquel and Lincecum struck out in the sixth before Winn broke up Oswalt's no-hit bid by beating out a grounder up the middle.
Aurilia pinch-hit for Lincecum leading off the eighth. Oswalt trotted out to start the inning, but manager Phil Garner jogged to the mound before he threw another pitch and replaced him with left-hander Trever Miller. Oswalt tipped his cap to a standing ovation before going into the dugout.
Aurilia flew out before Winn singled to start the Giants' rally.
Astros third baseman Mike Lamb then scooped up Lewis' grounder and threw to Biggio at second base, trying to start a double play. The ball sailed into right field and Winn headed to third. Scott threw to Lamb, but the ball skidded away and Winn scored easily. Lamb and Scott were both charged with errors.
- Bonds failed to homer for just the second time in San Francisco's past nine series. He's hit a home run in nine of 13 series this season.
- Astros rookie CF Hunter Pence struck out in the second inning after going 7-for-7 in the first two games of the series. He fell one short of the franchise record for consecutive at-bats with a hit.
- Winn extended his career-high hitting streak to 16 games.
- Durham left the game after his last at-bat with a strained groin. Bochy said Durham would be evaluated on Friday, before the Giants opened a three-game series in Oakland.