SAN FRANCISCO -- The Pittsburgh Pirates showed up in San Francisco mired in a 10-game losing streak with little going right. In two weeks, they'd fallen from first place to 10 games out.
Winning two from the reigning World Series champion Giants did a lot as Pittsburgh heads off to face the NL Central-leading Milwaukee Brewers in an important matchup of division rivals.
Andrew McCutchen hit a two-run homer, Jeff Karstens bounced back from his worst start of the season and the Pirates won their first series in three weeks with a 9-2 victory over the struggling Giants on Wednesday.
Pittsburgh is off Thursday before opening a weekend series with the Brewers, who have won all five previous meetings.
"We'll find out after the Friday night game, but we're going in with some confidence," Pirates manager Clint Hurdle said. "We were able to put a foot down and win a series on the road."
Garrett Jones added an RBI single to continue his torrid August and help back Karstens (9-6), whose career-high nine strikeouts matched a season high for the team. Karstens, who ended a four-start winless stretch, gave up a season-high nine runs and nine hits in a 15-5 loss at San Diego last Friday.
"It's good for us, especially heading into Milwaukee," Karstens said.
Pablo Sandoval homered for the Giants, who began the day with a half-game lead over the Arizona Diamondbacks in the NL West. The Diamondbacks host the Houston Astros in a night game. San Francisco has led the division since June 25.
Jonathan Sanchez (4-7) walked McCutchen on four pitches and threw five straight balls to start the game. Sandoval came in from third and catcher Eli Whiteside hustled to the mound to chat with the left-hander, who was roughed up again in his second start since coming off the disabled list with biceps tendinitis. Sanchez was done after 4 1/3 innings and hasn't won since June 2 at St. Louis.
McCutchen went 1-for-1 with three walks and a hit by pitch. He stole two bases and scored four runs -- the most by a Pirate in a game this year. His 16th clout of the year put Pittsburgh ahead 3-1 in the third. The Pirates have homered in four of their last five games and eight of 12.
McCutchen was hit by a pitch leading off the seventh. Brandon Wood drove in a run that inning and Matt Diaz hit two run-scoring singles. Pittsburgh's Nos. 1-5 hitters went a combined 7-for-17 with six RBIs, eight runs scored, seven walks and a hit batter. Jones is batting .389 (14-for-36) with five doubles, three homers and seven RBIs this month.
With a power show on offense of late, Bucs pitchers have also allowed 18 homers over the last nine games. Sandoval connected in the bottom of the first to tie the game at 1.
The Giants have hit 19 straight solo home runs, matching the 1914 Phillies' major league mark. Their last homer to score more than one run was a two-run drive by Nate Schierholtz on July 6 against the Padres.
San Francisco finished up a disappointing 3-7 homestand with its 10th loss in 13 games. The Giants have dropped three straight series at AT&T Park for the first time since losing six consecutive home series from May 12 to June 18, 2008.
"We've got a lot of baseball left," outfielder Cody Ross said. "We've got to go out and play like champions. We're not doing it. We're kind of all in a rut and it seems like we can't dig ourselves out. We've got to do something."
Giants manager Bruce Bochy said the front office would discuss whether to stick with Sanchez. Lefty Barry Zito had been unimpressive in the fifth starter role and went back on the disabled list Aug. 1, but he could come off when San Francisco needs that pitcher again Aug. 16 in Atlanta.
"It has me a little concerned," Bochy said of the No. 5 spot. "We need that guy to help us win a ballgame, too. We haven't had a good start there in I don't know how many now."
Pirates first baseman Derrek Lee was a late scratch from the lineup with a recurring left hand injury. Hurdle said Lee's hand was very sore after he played the two previous nights following a four-game absence with the bruised hand. Lee was hit with a pitch from the Chicago Cubs' Carlos Marmol last Wednesday.
Lee is batting .278 with two home runs and three RBIs in four games since joining the Pirates in a trade from the Baltimore Orioles.
Giants right fielder Carlos Beltran missed his third straight game nursing a strained right hand and wrist. Schierholtz was held out with a right hip flexor. ... Zito will make another rehab outing Saturday for Triple-A Fresno and then fly out to join the Giants on the road. ... San Francisco infielder Miguel Tejada (lower abdominal strain) isn't quite ready to begin a rehab outing in the minors, Bochy said. Tejada will travel on the road trip. ... Pirates right-hander Kevin Hart had arthroscopic cleanup surgery Tuesday performed by Dr. James Andrews in Pensacola, Fla. The team hopes to have Hart ready by spring training. ... Pirates left-hander Paul Maholm (6-12, 3.54 ERA) starts Friday trying to end a string of three straight losing decisions. He is 1-5 on the road and is coming off a 13-2 loss Saturday at San Diego. ... All-Star right-hander Matt Cain goes for the Giants on Friday at Florida, trying to improve to 4-1 for his career vs. the Marlins. He lost to Florida on May 24.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
Fantasy baseball: Tristan's three to add for Wednesday
Every Wednesday, Tristan H. Cockcroft identifies players who should be added to fantasy rosters.
Fantasy baseball daily notes: Pitcher and hitter rankings for Thursday
Prepare your fantasy baseball lineups confidently with our daily preview, including pitcher projections, hitter matchup ratings and more.
Betts homer in front of 52,078 leads Dodgers over Phillies
— Thousands of Dodgers fans got their first opportunity to see Mookie Betts play at home in person Tuesday night as stadiums in California were allowed to go to full capacity as part of eased COVID-19 restrictions.
Fantasy baseball: What to do with injured aces?
Eric Karabell takes a closer look at the numerous starting pitchers on the injured list, when fantasy managers might expect them back, and how to cope until they return.