SAN FRANCISCO -- Orlando Cabrera had become a bit concerned as San Francisco's skid hit five games while its offense sputtered.
Then, Cabrera started clicking with his new club and, suddenly, so did the rest of the Giants. And Ryan Vogelsong? He was his typical reliable self on the mound when it mattered.
Vogelsong won his career-best sixth straight decision, Cabrera hit a two-run double and drove in three runs, and the Giants remained atop the NL West with an 8-1 victory against the Arizona Diamondbacks on Wednesday.
"Man, finally. I was starting to worry," said Cabrera, who joined his ninth team since 2004 in a trade from Cleveland last week. "I'd like to believe if you win the World Series you have to hit at some point. It's basically the same team."
Vogelsong (9-1), the bright spot in a standout rotation this year, helped the Giants snap a five-game losing streak in which they were outscored 31-8, including a 9-0 loss Sunday at Cincinnati, and had their division lead trimmed by four games in as many days.
Carlos Beltran tripled among his three hits, scored twice and drove in a run in his best game since joining the Giants in a trade from the New York Mets last Thursday. San Francisco scored its most runs in a home game so far in 2011.
Beltran and Pablo Sandoval each hit RBI singles in a four-run third against Jason Marquis (8-6), who lost his Arizona debut four days after being acquired in a trade with Washington. The Giants scored four more runs in the fifth.
"We had two big innings. That's great for us," manager Bruce Bochy said. "It's been a while since we've had innings like that. ... This game was probably our biggest game to date of the season, with the losing streak. We had to stop the bleeding."
Marquis tossed a five-hit shutout of San Francisco on April 29, but this was Vogelsong's day all the way.
The right-hander allowed one run on five hits, struck out seven and walked three in six innings to lower his NL-best ERA to 2.19. He also owns the lowest home ERA in the majors (1.30) and his run of 10 straight starts at AT&T Park giving up two or fewer runs is the longest such stretch by a Giants starter since Scott Garrelts did it in 12 consecutive outings from June 11, 1986, to July 16, 1989.
Vogelsong has been the Giants' most reliable starter and hasn't lost since May 26 against Florida. He extended his career high for victories Wednesday with a 108-pitch performance in which he withstood deep counts for much of the afternoon. Not bad for a guy who just keeps improving after showing up at spring training as a non-roster invitee, getting promoted in mid-April, then becoming an improbable All-Star at age 33.
"I think it's a little too early to be pushing the panic button," Vogelsong said. "Obviously I knew we'd lost five in a row and we needed to win."
After Zach Duke's seventh-inning RBI single got Arizona on the board and chased Vogelsong, Guillermo Mota entered and struck out the side in both the seventh and eighth for a career high-tying six Ks.
Aubrey Huff's single in the fifth was the fourth straight hit to start the inning off Marquis, who left after giving up 10 hits and a season-high seven earned runs. Cody Ross had a two-run double moments later to spoil Brad Ziegler's first outing with Arizona since a trade from Oakland on Sunday.
Bochy shook up his lineup in an effort to get things going, and it worked wonders.
Andres Torres returned to the leadoff spot and center field. Beltran, slated to be the regular No. 3 hitter, batted cleanup and Sandoval moved up a spot to third. Ross drew two walks and drove in three runs in the No. 7 hole.
"We have good hitters in our lineup," Beltran said. "Sometimes we get caught up in trying to do too much. It happens to every team."
The Giants were outscored 11-3 in first two games of the series as Arizona moved into a tie for first in the West heading into the finale, but they denied the D-backs the chance to move into sole possession of first place for the first time since a four-day stretch atop the standings that ended June 25.
"In the grand scheme of things, we got a lot accomplished on the road trip," D-backs center fielder Chris Young said. "We played good baseball and got a lot closer in the race. We just need to keep pushing forward from there."
San Francisco's losing streak matched its longest this season. Giants starters were 0-4 with a 6.51 ERA during the skid, making Vogelsong's outing all the more important.
Sandoval put the Giants -- who had gone 12 straight games without scoring more than four runs -- ahead in the third with an RBI single and Beltran followed with one of his own during as sequence of four straight base hits and an RBI groundout by Cabrera off Marquis.
D-backs slugger Justin Upton struck out three times and had his 14-game hitting streak snapped.
Mota last struck out six in a game during a three-inning outing on May 29, 2003, with the Dodgers. ... The Giants are 12-5 on Wednesdays. ... San Francisco LHP Madison Bumgarner tries to bounce back Thursday night against the Phillies and ace Cliff Lee after lasting just four innings his last time out, allowing five earned runs on seven hits with three walks and four strikeouts. It will be his first regular-season matchup with Philadelphia after starting Game 4 of the NL championship series vs. the Phillies and also making a relief outing in Game 6. ... The Diamondbacks head home for a 10-game stay at Chase Field but get Thursday off before opening a weekend series with the Dodgers. LHP Joe Saunders starts Friday night for his second straight start vs. L.A. after beating the Dodgers on July 31. He will try for his third straight win overall. Saunders has had quality starts in eight of his last nine outings, going 5-2 with a 2.30 ERA.