Madison Bumgarner hit his fifth homer of the season and Marlon Byrd drilled his 20th in his first game with the defending World Series champions , as San Francisco held off the Pittsburgh Pirates 6-4 on Friday night to climb within 1 1/2 games of the Dodgers for first in the NL West.