Jorge Alfaro had a career-high four hits and the Miami Marlins handed the San Francisco Giants their seventh consecutive loss with a 4-2 victory Wednesday night.

Neil Walker had a tiebreaking, pinch-hit double in the seventh and Starlin Castro hit the first triple of the season for the Marlins, who have won nine of 12.

San Francisco’s Madison Bumgarner (3-5) allowed two runs and six hits in six innings.

Miami Marlins' Austin Dean is congratulated in the dugout after scoring on a sacrifice fly by Starlin Castro during the third inning of the team's baseball game against the San Francisco Giants, Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)
Miami Marlins’ Austin Dean is congratulated in the dugout after scoring on a sacrifice fly by Starlin Castro during the third inning of the team’s baseball game against the San Francisco Giants, Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)

Brandon Belt hit his eighth home run of the season and drove in both runs for the Giants.

Marlins starter Pablo Lopez allowed four hits and one run in six innings. Nick Anderson (2-2) pitched a scoreless seventh while Sergio Romo escaped the ninth for his 11th save in 12 chances after allowing a sacrifice fly to Belt and leaving runners stranded at the corners by striking out Steven Duggar to the end the game.

Walker hit a double down the right-field line off Mark Melancon, scoring Alfaro, and Garrett Cooper added a sacrifice fly in the seventh extending the lead to 3-1.

San Francisco Giants starting pitcher Madison Bumgarner (40) talks with catcher Buster Posey during the third inning of the team's baseball game against the Miami Marlins, Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)
San Francisco Giants starting pitcher Madison Bumgarner (40) talks with catcher Buster Posey during the third inning of the team’s baseball game against the Miami Marlins, Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)

Castro led off the eighth with a triple to center when Steven Duggar’s diving attempt came up empty and the ball rolled to the wall. Castro scored on a base hit by Harold Ramirez for a 4-1 lead.

Castro gave the Marlins an early lead with a sacrifice fly and Belt tied it with a home run to right-center.

MARLINS EYEING HITTERS IN DRAFT

Miami Marlins starting pitcher Pablo Lopez stands on the mound as San Francisco Giants' Brandon Belt rounds the bases on a solo home run during the fourth inning of a baseball game Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)
Miami Marlins starting pitcher Pablo Lopez stands on the mound as San Francisco Giants’ Brandon Belt rounds the bases on a solo home run during the fourth inning of a baseball game Wednesday, May 29, 2019, in Miami. (AP Photo/Lynne Sladky)

The Marlins will pick 4th, 35th, and 46th on the first day of the MLB Draft on Monday and will be on the lookout for position players.

“I would say right now our mindset is on position players,” chief executive officer Derek Jeter said. “I think we have a great deal of depth in our organization on the pitching side. Having said that you can never have enough pitching, but I think the top of the draft at least we’re looking more towards position players.”

TRAINER’S ROOM

Miami Marlins' Austin Dean tosses his bat after hitting a single during the third inning of the team's baseball game against the San Francisco Giants, Wednesday, May 29, 2019, in Miami. At right is Giants catcher Buster Posey. (AP Photo/Lynne Sladky)
Miami Marlins’ Austin Dean tosses his bat after hitting a single during the third inning of the team’s baseball game against the San Francisco Giants, Wednesday, May 29, 2019, in Miami. At right is Giants catcher Buster Posey. (AP Photo/Lynne Sladky)

Giants: RHP Nick Vincent (pectoral strain) was placed on the 10-day injured list. “If I had to guess (he will be out) two to three weeks, but don’t hold me to that,” manager Bruce Bochy said. “It’s a pec strain and sometimes these things take a little bit longer, but that’s my guess.” . RHP Trevor Gott (forearm) threw 15 pitches off the mound. . LHP Travis Bergen (shoulder) is scheduled to throw off the mound in Arizona on Thursday.

UP NEXT

Giants: RHP Tyler Beede (0-1, 13.50 ERA) will be recalled from Triple-A Sacramento to make his second start of the season.

Marlins: RHP Sandy Alcantara (2-5, 4.50) allowed five runs, four earned, in five innings in his last start at Washington.