SAN FRANCISCO -- After going 0-1 with a 7.71 ERA in his first four starts this season, Giants right-hander Ryan Vogelsong knew what he had to do.
"First of all, you have to stop digging the hole to get out of it, and second of all, you have to believe that you can do it," Vogelsong said Sunday. "When they believe in you, too, that goes a long way. That helps a lot."
Vogelsong continued bouncing back from his nightmare start, throwing seven shutout innings in Sunday's 4-1 victory against the Miami Marlins at AT&T Park. Vogelsong (2-2) allowed one or fewer runs for the fourth time in his past five starts. He allowed just five hits, all singles, struck out six and walked one as the Giants snapped a two-game losing skid and earned a split in their four-game series with Miami.
"He had a good fastball, had good command of it," Giants manager Bruce Bochy said. "He worked ahead in the count. He used his other pitches off of the fastball. Had a good changeup, breaking ball to go along with it. He was in command the whole way. Just a great job. He's been throwing the ball well. His last start he should have fared better. He carried that stuff into today's game. The key for him was he threw early strikes and quality strikes."
Vogelsong gave up four runs over six innings in his last start, a 5-0 loss to Atlanta on Tuesday, but he also struck out eight, matching his career high.
Vogelsong said his fastball against Miami was "OK" but far from overpowering.
"I know I don't have the fastball that I had a couple years ago, so I felt like I had to do a better job of setting it up today because they're a very aggressive team, especially with fastballs and fastball counts," Vogelsong said. "I just tried to use my offspeed stuff to set that up."
Giants third baseman Pablo Sandoval continued bouncing back from his rough start, too. Sandoval hit his third home run of the season, a solo blast in the fifth inning. He extended his hitting streak to nine games with a first-inning single. Sandoval has hit .389 (14-for-36) during his streak, raising his average from .171 to .220. He's hit three doubles and one home run, driven in five runs and scored five runs in that stretch.
"He's been swinging the bat well," Bochy said. "I think it good for him to hit a home run. It's been awhile."
Marlin right-hander Jacob Turner (0-2) took the loss and fell to 0-11 in 18 career road starts. He gave up four runs on six hits over six innings, striking out seven, walking one and hitting a batter.
"Give them credit," Turner said. "I made some good pitches and they got hits on them. I made a couple of mistakes, too. You don't want to hit the leadoff batter on an 0-2 pitch."
The Giants grabbed a 3-0 lead in the first inning, sending eight batters to the plate against Turner.
Center fielder Gregor Blanco, leading off, was hit by a Turner pitch, stole second, moved to third on right fielder Hunter Pence's groundout and scored on catcher Buster Posey's sacrifice fly to deep left-center field.
The Giants strung together singles by Sandoval, first baseman Michael Morse, left fielder Tyler Colvin and second baseman Brandon Hicks, adding two more runs. Colvin's sharp single to center brought Sandoval home, and Morse scored on Hicks' base hit to left.
"I had a game plan in place that I was going to go with no matter what, but you're able to attack guys a little bit more when there's early runs on the board, runs at all," Vogelsong said. "That was a big factor today. It was great to see. We came out and got on him early. He settled down pretty good after that."
The Marlins nearly broke through against Vogelsong in the fifth inning, but shortstop Brandon Crawford made a spectacular play for the third out, stranding runners on second and third. Crawford ranged far to his left and made a diving stop of Miami shortstop Adeiny Hechavarria's sharp ground ball. Crawford got up quickly and threw a strike to Morse at first for the out.
With two outs in the bottom of the fifth, Sandoval sent Turner's first-pitch fastball over the left-field fence for an opposite-field home run, his first since April 13 against Colorado.
The Marlins scored a run in the eighth off left-hander Jeremy Affeldt.
Eric Gilmore is a contributor to MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.