SAN FRANCISCO — Wilmer Flores drew a bases loaded walk in the ninth, capping a wild comeback as the San Francisco Giants snapped a five-game skid with a 5-4 victory over the Chicago Cubs on Monday night.
Matt Chapman homered and started the rally with a bloop double off Colten Brewer.
Flores was the eighth Giants player to bat in the ninth. His walk scored Patrick Bailey, who singled with one on and one out in a 4-3 game to score Chapman, and Austin Slater's sacrifice fly two batters later tied the game.
''We all got to wear No. 24, and that's pretty cool,'' Giants manager Bob Melvin said, acknowledging the win was especially meaningful on a night when the team held a tribute for franchise legend Willie Mays before the game.
''All the stuff pregame, it certainly gets your attention, and we've been thinking about this all week and finally win a game for him,'' Melvin said. ''Whether it was Rickwood or whatever, we had trouble winning games during his tributes, so it was good to be able to do it at home here.''
Reliever Drew Smyly (2-4) took the loss.
Giants reliever Spencer Howard (1-1) struck out eight and walked one in 4 2/3 scoreless innings of four-hit ball.
Dansby Swanson's RBI double highlighted a three-run fifth inning in which Chicago opened up a 4-0 lead.