SAN FRANCISCO -- As Tim Lincecum threw his warmup pitches before the sixth inning, D-backs manager Kirk Gibson glanced to his left and saw his first baseman, Paul Goldschmidt, bat in hand, standing on the dugout steps with his eyes closed.
"After about 10 or 15 seconds, I said, 'Hey, are you OK?'" Gibson said. "He looked up to me and he said he was visualizing. I said, 'Go show me what you were visualizing.'"
Goldschmidt walked up to the plate and hit a 1-0 pitch from Lincecum into the bleachers for a go-ahead homer as the D-backs beat the Giants, 4-1, on Wednesday night in front of a sellout crowd at AT&T Park.
With the win, the D-backs managed to avoid a sweep in the three-game series.
Goldschmidt may have been visualizing the hit before his at-bat, but it's likely that Lincecum sees Goldschmidt home runs in his nightmares.
Wednesday's blast was Goldschmidt's fourth in 13 career at-bats against Lincecum. That's the most homers anyone has hit off the Giants' two-time Cy Young Award winner.
"Just hitting the ball hard," Goldschmidt said when asked what he was picturing before the at-bat.
Asked to explain his success against Lincecum, Goldschmidt could only shrug his shoulders.
"I wish I knew because then I'd try to do it all the time," Goldschmidt said. "I've been ahead in the count a lot, I think. The four homers -- a 2-0 pitch, a 2-1, a 3-1 and now a 1-0 -- so anytime you're getting in good hitter's counts, your chances of getting a hit or a home run are going to be a lot better than if you're down 0-2 and trying to battle."
Goldschmidt does not boast about his success against Lincecum, because he knows that it could be fleeting.
"Every hitter knows what you've done against previous pitchers and I'm sure the pitchers know as well," Goldschmidt said. "But it's not like you're up there thinking about it or anything. I've said this before: It can change in a hurry. It just takes one AB to get hot or vice versa. That's why in this game you've got to just stay positive even if things are going bad."
Lincecum was asked if he was hoping to one day stick Goldschmidt with an 0-for-4 game.
"I'm not hoping," Lincecum said. "I'm going to figure it out."
The Giants were unable to solve D-backs starter Ian Kennedy, who snapped a five-start losing streak with his first win since April 22.
The Arizona bullpen has thrown a lot of innings lately, and on top of that, Gibson found out in the fourth inning that closer J.J. Putz would be unavailable due to a stiff neck.
With that in mind and given the fact that he would get an extra day before his next start due to Thursday's day off, Gibson asked Kennedy if he could go out for the eighth inning and extend his pitch count well above 100.
"I was willing to take it," said Kennedy, who threw a career-high 122 pitches. "I felt good, we've got an extra day coming up and as starters that extra day is nice and allows us to go a little further."
Kennedy (4-5) allowed one run on five hits while striking out seven in 7 2/3 innings.
Setup man David Hernandez picked up the final four outs to record the save.
"It was unbelievable the way Ian got out there and he really battled for us," Goldschmidt said. "It was huge. That's why he's the ace."
During his between-starts bullpen session, Kennedy said that bullpen catcher Jeff Motuzas noticed a slight mechanical flaw. Once corrected, it allowed Kennedy to stay on top of his pitches more.
"I think better command, more confidence and conviction," Gibson said when asked for the difference in Kennedy from his previous five starts.
The D-backs added a pair of insurance runs in the eighth off reliever Steve Edlefsen, with Goldschmidt and Ryan Roberts delivering a pair of RBI singles.
Steve Gilbert is a reporter for MLB.com. Read his blog, Inside the D-backs, and follow him on Twitter @SteveGilbertMLB. This story was not subject to the approval of Major League Baseball or its clubs.