Houston was playing without first baseman Lance Berkman, who's on the disabled list with a strained left calf, and center fielder Michael Bourn, who missed Wednesday's game with a groin strain. Roy Oswalt and Wandy Rodriguez, the club's top two starters, are both battling nagging injuries.
The Astros only have four quality starts in their past 12 games, with the starters going 2-6 with an 8.53 ERA during that span. Moehler (7-7) had seven quality starts in his previous nine outings before allowing nine hits and seven runs (six earned) against the Giants.
"I left some pitches out over the plate and they hit them, and I had to throw a strike there to their catcher, and I didn't hit my spot and he hit it out," Moehler said. "You've just got to try to make a quality pitch without getting behind the count. I didn't execute. Bottom line. He hit it out, and we were done then."
San Francisco has won 10 of 14 and 18 of 30 games against the Astros, including four of six this season.
"The Giants own us, they proved it again today, and we're happy we don't have to play them 10 more times," infielder Geoff Blum said.
Moehler took a 3-2 lead into the sixth and had sent down nine batters in a row when things went awry.
Pablo Sandoval had a one-out single in the sixth, went to second on a wild pitch and scored the tying run on Ryan Garko's single. Aaron Rowand moved Garko to third with a double, and the Astros opted to load the bases by intentionally walking Edgar Renteria.
The first pitch Moehler threw to Whiteside was crushed and sent over the left-field wall for a game-changing grand slam.
"I'd like to have a couple of pitches back, but I didn't feel like I was laboring today," Moehler said. "But I didn't execute when I needed to, either. Bottom line is I got beat today. One pitch and that was the ballgame."
It was the first career homer for Whiteside, who joined the team in May.
"It felt pretty good, especially since I haven't helped the team out offensively too much the last few games I've played," Whiteside said. "It was nice to put the barrel on the ball and help the team out with four RBIs. It just felt good."
The Astros had a couple of runners on base in both the seventh and eighth innings but managed only one run. Hunter Pence hit a two-run homer in the ninth to cap the scoring. Houston was 3-for-10 with runners in scoring position.
"I thought we had a chance, even in the eighth inning, to jump back into it," Cooper said. "One big swing and we're back there or even a base hit and we could have narrowed the game or even had a chance at it, but they tack on and it makes it a little tougher."
The Astros took a 3-0 lead in the second inning against Giants starter Joe Martinez, who was making his first Major League start. Jason Michaels, starting in place of Bourn, had a two-run double in the second before scoring from second on Kaz Matsui's infield hit.
Sandoval's two-run single with the bases loaded in the third got the Giants within 3-2.
"Too many mistakes at key moments," Cooper said. "That's kind of what's happened to us here the last couple of ballgames, and we need to get ourselves squared away a little bit."