Clint Barmes has long been a reliable shortstop for manager Clint Hurdle. From Colorado to Pittsburgh.

On Saturday night, he misfired and cost the Pirates another close game in a season already full of them.

Emmanuel Burriss scored the winning run on Barmes' throwing error in the ninth inning to give the Giants a 4-3 win and hand Pittsburgh its fifth straight loss.

With the bases loaded and nobody out, Cabrera hit a sharp grounder to Barmes, who was playing in at the edge of the infield grass. He made a low throw home that bounced in front of catcher Rod Barajas, who tried to make a backhand stop as the ball skipped away.

"The ball was hit hard to me. I had plenty of time to catch it, square myself and make a good throw to Rod," Barmes said. "I caught the ball and just tried to be too quick and make a good throw. That play, that part of the game, you have to make that play. No excuses for it. I didn't."

The Giants earned their second straight series victory, after Matt Cain tossed a one-hitter in a 5-0 win Friday. Four of Pittsburgh's six losses were by one run — and the Pirates' two victories also were by one run.

San Francisco has won four of five since being swept in three one-run losses at defending NL West champion Arizona to open the season.

The win was a nice morale boost for the Giants on a night they learned All-Star closer Brian Wilson is likely headed for surgery and could miss the season because of structural damage and a ligament problem in his troublesome right elbow. He will go on the disabled list Sunday, when Ryan Vogelsong is activated from the DL to start the series finale.

Santiago Casilla will be considered along with Javier Lopez and Sergio Romo to close in Wilson's place.

"It's going to take getting everybody to contribute," Giants manager Bruce Bochy said. "Right now they're doing that."

Burriss hit a leadoff single in the ninth off Chris Resop (0-1), and pinch-hitter Ryan Theriot followed with a sharp single to right that moved Burriss to third. Hurdle visited Resop, and Angel Pagan drew an intentional walk to load the bases for Cabrera, who delivered to chants of "Melky! Melky!" from the sellout crowd of 41,657.

Lopez (1-0) retired one batter for the win, striking out Alex Presley to end the ninth with the potential go-ahead run on second.

Pagan tripled, singled, scored a run and stole his first base for San Francisco, and new shortstop Brandon Crawford made several snazzy plays with his glove. Pagan is 9 for 12 against Pittsburgh starter Charlie Morton.

The Pirates couldn't hold a 2-0 lead for Morton, though Hurdle was happy to see his team score some early runs.

"You want to get out of the blocks. It's something we did last year extremely well, so at least it's a step in the right direction," Hurdle said.

Morton came off the disabled list to make his 2012 debut after recovering from offseason hip surgery. He hung tough for five innings, allowing three runs on seven hits with two strikeouts and no walks.

"Just a mediocre outing. Kind of squandered the offense that we had," Morton said. "We had an opportunity to go out there and win that game early. To give the lead up is just not good. I would have been totally fine if I had pitched better. After an outing like that where I felt like I could have done a better job, that's the only thing I was upset about."

Pablo Sandoval made it 3-all in the fifth on an RBI infield single that he lined toward Morton, and the Kung Fu Panda has hit safely in each of the first eight games.

Pittsburgh took a 3-2 lead in the top half on a pair of errors on the same play. Sandoval misplayed Jose Tabata's grounder at third base and the ball went under his glove into left field. Crawford, backing up Sandoval, then threw wildly to second, allowing Presley to score.

Sandoval committed a second fielding error in the sixth for his fourth career multierror game. His last came Aug. 9, 2011, also against the Pirates. He has three errors already this season after making just 10 last year.

Nate Schierholtz's triple drove in a run in the second, then Burriss added an RBI single.

It was another encouraging outing for Barry Zito after he tossed his first shutout in nine years in a four-hit, 7-0 victory at Colorado on Monday to give the Giants their first win of the year.

Zito allowed three runs — two earned — and six hits in seven innings, struck out four and walked one.

NOTES: The Pirates optioned INF Matt Hague to Triple-A Indianapolis to clear room for Morton's return to the roster. ... The Giants held a moment of silence in tribute to Matty Alou, who died during the offseason at age 72. He made history as a member of an all-Alou outfield for San Francisco with brothers Felipe and Jesus.