PHOENIX (AP) Someone had been to the costume shop, and Matt Duffy was about to put on faux leather boots, chaps and a pink cowboy hat to complete his travel ensemble.
The annual ritual of making rookies wear unflattering outfits on one of the last road trips of the season was underway in the Giants' clubhouse, but it hardly bothered Duffy.
''I told them I feel so good right now, they can dress me up in whatever they want,'' Duffy said Wednesday after his pinch-hit single in the ninth inning sent San Francisco to a 4-2 win over the Arizona Diamondbacks.
Duffy snapped a tie with a two-run single and the Giants narrowed their gap in the NL West, pulling within two games of the first-place Los Angeles Dodgers, who lost 16-2 at Colorado. The contenders both have 10 games left.
Duffy's hit came on a full count with the bases loaded against closer Addison Reed (1-6). Pablo Sandoval walked with one out, Brandon Crawford singled and pinch-hitter Brandon Belt walked, setting up Duffy. Crawford had four hits.
Now 4 for 10 as a pinch hitter, Duffy did not play in Triple-A this season and was called straight up from Double-A on Aug. 1. Giants manager Bruce Bochy showed faith in him in a key situation during a playoff race.
''When he shows confidence in you, you have confidence in yourself,'' Duffy said. ''It's a good feeling, definitely.''
Bochy said Duffy has shown good composure since his call-up.
''That's not the first time he's gotten a big hit for us,'' Bochy said. ''I like him in that situation.''
Sergio Romo (6-4) pitched one inning, and Duffy batted for him. Santiago Casilla got his 17th save.
Diamondbacks manager Kirk Gibson said Reed was overworked.
''This was his fifth day in six either in the game or heating up. He just didn't have it,'' Gibson said.
Crawford hit an RBI double in the second for a 1-0 lead.
Andrew Chafin, making his second major league start, tied it in the Arizona second with an RBI single off Madison Bumgarner. The hit came in Chafin's first big league at-bat.
Bumgarner labored through six innings, allowing at least two baserunners in the first three. Trying for his 19th win, he gave up seven hits and struck out six.
''I was having to battle and try to make pitches and keep us in the game,'' Bumgarner said. ''Fortunately, I was able to do it.''
The Giants took the lead in the fifth thanks to an infield hit, a walk, a wild pitch and a pair of sacrifices that produced one run.
Bumgarner gave up the tying run in the bottom of the fifth, when A.J. Pollock ran home on a thrown third strike that bounced to Giants catcher Andrew Susac.
Susac threw out Mark Trumbo at first base, but Pollock hustled to the plate on the throw and beat Buster Posey's return throw to Susac.
Chafin allowed two runs on three hits with four walks and two strikeouts in six innings.
The Giants admittedptq to looking at the out-of-town scoreboard at Chase Field to see how the Dodgers were doing against the Rockies during the course of the afternoon.
''The scoreboard here is right in front of you,'' Bochy said. ''Now we've got three big games in San Diego and that's where our focus is going to be.''
Giants: OF Angel Pagan was scheduled for an MRI for his back injury, and missed his third straight game. ... OF Michael Morse is still out with a strained oblique. Belt played for the first time since being activated Monday following a concussion. He will remain in Arizona on Thursday to get at-bats in the instructional league before rejoining the team.
Diamondbacks: 3B Jake Lamb (quadriceps) remains limited, but is expected to return to the lineup when the team plays at Colorado beginning Thursday. Lamb came on as a pinch hitter on Tuesday and struck out.
Giants: RHP Tim Hudson (9-11) pitches Friday in San Diego after the club gets Thursday off. He's coming off the worst start of his career, in which he allowed six runs on eight hits in one inning of a 17-0 loss to the Dodgers last week.
Diamondbacks: LHP Vidal Nuno (0-6) faces the Rockies in the opener of a four-game series Thursday. Nuno has a 2.31 ERA over his last five starts. He allowed one earned run in eight innings against the Rockies on Aug. 30 but took the loss.