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.