SAN FRANCISCO (CBS/AP) — Jake Peavy pitched seven innings for his first win and added a two-run single off Miami ace Jose Fernandez, and the San Francisco Giants beat the Marlins 7-2 on Saturday night.

Gregor Blanco tripled twice and scored two runs while Matt Duffy had three hits and scored for the Giants, who have won two straight following a five-game losing streak.

READ MORE: UPDATE: Atmospheric River: I-880 Shutdown, Flooded Roadways, Damaged Homes, Massive Rockslides In Storm's Wake

Peavy (1-1) failed to get past the fifth inning in his three previous starts and had another up-and-down outing against the Marlins before finishing strong to end his skid.

Miami had runners on base in each of the first six innings but Peavy repeatedly pitched out of trouble while giving up two runs, seven hits with four strikeouts and one walk.

Fernandez (1-2) allowed four runs over six innings in his first career start at AT&T Park.

The Giants led 2-0 and loaded the bases with two outs in the fourth when Fernandez intentionally walked Gregor Blanco. The move backfired quickly when Peavy lined a two-run single to left.

San Francisco’s 2007 NL Cy Young winner also made a sparkling defensive play an inning earlier after Miami scored on Marcell Ozuna’s two-out RBI triple. One batter later Peavy made a sliding grab on Christian Yelich’s slow dribbler toward third base and threw from his knees to first for the out.

Fernandez singled twice and scored for Miami. Justin Bour added three hits.

READ MORE: Atmospheric River: High Winds Topple Trees, Scaffolding in San Francisco

CHANGING BACK

Miami right-hander Jarred Cosart is changing his pitching mechanics after three consecutive rough outings. Cosart has issued 15 walks in 14 2/3 innings and traces his problem to a change in hand placement that he made toward the end of spring training. The decision was made to go back to his previous style after meeting with manager Don Mattingly. “I think for the long haul I need to go back with something that feels comfortable, something that works for me,” Cosart said.

TRAINER’S ROOM

Marlins: INF Martin Prado, who left the team Friday morning to be with his wife in Miami for the birth of their child, was placed on the paternity leave list. LHP Cody Ege was called up from Triple-A New Orleans to take Prado’s spot on the roster.

Giants: Angel Pagan held out of the starting lineup after playing in San Francisco’s first 18 games. The veteran outfielder, who leads the team with a .328 average, had a pinch-hit sacrifice fly in the eighth.

UP NEXT

Marlins: LHP Adam Conley (0-1) starts on Sunday and is second on the staff behind Fernandez with 19 strikeouts.

MORE NEWS: Atmospheric River: Parts of San Mateo County Pummeled with Heavy Rain, Flooding

Giants: RHP Matt Cain (0-2) pitches the finale for San Francisco seeking his first win of the year. All 11 of the runs Cain has given up this season have come in the fifth inning.

© Copyright 2016 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.