SAN FRANCISCO -- Mauricio Dubon hit a three-run homer off reliever Yency Almonte in the fifth inning and the San Francisco Giants beat the Colorado Rockies 7-2 on Wednesday night to move barely in front in a crowded NL wild-card race.
Logan Webb (3-4) allowed two runs and seven hits in 5 1/3 innings to win in his first career appearance as a reliever.
The Giants (28-27) have won three of four and are percentage points ahead of Cincinnati for the first of two NL wild cards. The Reds (29-28) won earlier against Milwaukee (27-28), another close contender.
"Being in this clubhouse is really fun," Dubon said. "You're playing meaningful baseball and every hit, every run, every home run, every catch you make counts. That's the fun part of it."
Raimel Tapia had two hits and an RBI for Colorado.
Dubon's homer on Almonte's second pitch came just after Rockies manager Bud Black pulled starter Ryan Castellani following walks to Belt and Longoria. It was Dubon's third home run this season and the seventh of his career.
"It was a huge confidence boost for him because he has been hitting some balls on the button that haven't left the ballpark," Giants manager Gabe Kapler said. "That confidence spilled over into the dugout. It was one of the more exciting moments of the last couple weeks."
Longoria homered off Castellani leading off the fourth to snap an 0-for-16 slide.
Webb pitched in relief after the Giants used an opener for the first time this season. Caleb Baragar, who is 5-1 coming out of the bullpen, retired three batters and left after allowing Charlie Blackmon's double leading off the second.
"I can't remember the last time I came in with somebody on base," Webb said. "It was fun out there. I don't know if that changed necessarily the game plan or the mindset of that. It was my first time experiencing that and it was cool."
Kapler felt using an opener helped get Webb locked in more easily.
"I think it did a lot for his mindset," Kapler said. "After Baragar set the tone for us by pounding the strike zone, Logan was able to see how important it was to attack the strike zone. He was comfortable inducing contact, and some of that contact was hard. That's OK. But I think what allowed him to be efficient was his willingness to live with that contact."
Castellani (1-4) walked five and allowed five runs in 4 2/3 innings.
"His challenge moving forward as a major league pitcher is to command the fastball and get the ball-strike ratio much better," Black said. "You've seen over the course of his outings, the pitch count rise. Big league hitters have a discernible eye, much more so than a minor league hitter. He's learning that firsthand."
Rockies third baseman Ryan McMahon made a spectacular catch in foul territory in the fourth. McMahon initially ran through the coaching box chasing Joey Bart's high popup into the swirling wind at Oracle Park, then abruptly changed direction and dove back toward third base to snag the ball. McMahon was starting in place of seven-time Gold Glove third baseman Nolan Arenado, who went on the 10-day injured list Monday with left AC joint inflammation and a left shoulder bone bruise.
MORE DEFENSIVE GEMS
Longoria and Giants shortstop Brandon Crawford also made a handful of standout plays, most notably Crawford's grab of Blackmon's hard liner in the fourth when San Francisco was in a defensive shift, leaving Crawford alone on the left side of the infield.
Rockies: OF David Dahl will seek an opinion on his strained right shoulder from a doctor in Birmingham, Alabama, in the clinic of Dr. James Andrews. Black said Dahl doesn't know whether he injured himself on a throw or a swing. Dahl was placed on the 45-day injured list and the Rockies selected the contract of RHP Tommy Doyle from their alternate site. ... RHP Scott Oberg, sidelined by blood clots in his pitching arm, underwent surgery for thoracic outlet syndrome. The surgery was performed by Dr. Darren B. Schneider at Penn Medicine in Philadelphia. "We're very hopeful that will help Scotty to have another go at a big league season and beyond," Black said. "The hope is and we have faith that he will be ready to go by spring training."
Giants: Tests revealed OF Luis Basabe, placed on the 10-day injured list, sustained a Grade 1 right hamstring strain running to first base Tuesday night. Kapler called it a "three- to four-week injury." ... The Giants recalled OF Steven Duggar from their Sacramento alternate site to fill the void. ... OF Mike Yastrzemski, who had missed five straight games with a mild right calf strain, was going to go through all his pregame work before the Giants determined if he could be a pinch-hit option off the bench.
Colorado RHP Chi Chi Gonzalez (0-2, 7.53 ERA) starts the series finale Thursday afternoon. Gonzalez is winless in three career starts against San Francisco. The Giants had not announced a scheduled starter.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
The MLB teams with the most serious work still to do this offseason
The Mets did their work by adding Francisco Lindor. Now, the spotlight moves to those who have big holes to fill. Enter the Twins, Phillies, Blue Jays and Red Sox.
Former Oakland Athletics pitcher Dave Stewart bids $115 million on share of Oakland Coliseum
Former Athletics pitcher Dave Stewart submitted a bid to buy a share of the Oakland Coliseum with plans to develop the site should the A's leave the ballpark.
Tri-City ValleyCats suing Major League Baseball, Houston Astros
The Tri-City ValleyCats, who operated as a short-season affiliate of the Houston Astros for 18 seasons before being dropped, have filed a lawsuit against Major League Baseball and the Astros.
LHP Martin Perez returns to Boston Red Sox on one-year deal, source says
Veteran starter Martin Perez has agreed to a one-year, $5 million guaranteed contract to return to the Boston Red Sox, a source confirmed to ESPN's Jeff Passan.
Baltimore Orioles reach one-year deal with recovering Trey Mancini
— The Baltimore Orioles agreed to a $4.75 million, one-year deal with recovering slugger Trey Mancini on Friday but haven't come to terms yet with outfielder Anthony Santander.
New York Yankees roll dice on Corey Kluber: Will he return to Cy Young form?
If the longtime ace bounces back from two injury-plagued seasons, New York might have just reeled in one of the biggest fish of this offseason.