SAN FRANCISCO (AP) -- Paul Goldschmidt has spent two days in the major leagues and he already feels at home. That's what a home run against one of baseball's top pitchers can do for the psyche.
Goldschmidt hit his first career homer, a two-run shot off Tim Lincecum that helped the Arizona Diamondbacks move into a tie for first place in the NL West with the Giants by beating San Francisco 6-1 on Tuesday night.
"To come up here in this environment and do what he's done is a huge lift for us," Arizona manager Kirk Gibson said. "He's become part of our team. You have to be awed by it. He's shown great character by the way he's controlled his emotions."
Justin Upton added a two-run home run as the Diamondbacks won their fourth straight to grab a piece of the division lead for the first time since June 24. Ryan Roberts had two hits and drove in a run.
Goldschmidt sounded like the calmest player in the clubhouse when he spoke about his first two days in the bigs.
"It was nice to get the win," he said. "Any time you get a hit or have a good at-bat it will help your confidence. I just got a couple of pitches to hit."
Goldschmidt, who led all minor leaguers in home runs (30) and RBIs (94) when he was called up Monday, said he looked back to previous experiences to keep him levelheaded.
"I look back to the minors, college, even high school," he said. "That pressure, at that time, was just as big as it is now."
Daniel Hudson (11-7) outdueled the two-time Cy Young Award winner Lincecum to snap a two-game slide against the Giants and win for the eighth time in his last 10 decisions. He allowed one run on six hits over eight innings. He walked one and struck out five.
"It's a lot of fun but at the same time there's a long way to go," Hudson said. "The division goes through San Francisco and we have a lot of games left with the Giants."
Lincecum (9-9) lasted seven innings, giving up two runs on three hits, all in the fifth. He walked three and struck out eight.
"I lost it there for a while," Lincecum said. "But overall, with the exception of that one pitch, I thought I pitched pretty good."
Pablo Sandoval had three hits, including an RBI double, for the Giants, who matched their season-high five-game losing streak.
Hudson set down nine of the first 10 hitters he faced, with Orlando Cabrera 's bunt single leading off the third the lone batter to reach safely. Cabrera was caught stealing 2-6-3-4-8. Bryan Shaw pitched the ninth to finish it.
Lincecum took a no-hitter into the fifth inning before Roberts singled ahead of Goldschmidt's deep drive into the left field bleachers.
"He worked early in the game but that was a great effort by him," Giants' manager Bruce Bochy said. "He had good stuff and his velocity was good."
Upton's 22nd home run, a two-run shot off Ramon Ramirez , were the first runs scored against the Giants' bullpen since the All-Star break, a span of 18 innings. Upton extended his hitting streak to 14 games with the homer.
Roberts added an RBI double and Gerald Parra an RBI single in the ninth against Javier Lopez .
The Diamondbacks have won 12 of 17 games to make up 4 1/2 games on the Giants.
NOTES: Giants INF Freddy Sanchez underwent surgery on his torn right labrum in Arizona and will likely be ready by spring training. ... RHP Ryan Vogelsong will start Wednesday's game against the Diamondbacks. His eight wins are a career high. He is 1-1 with a 2.81 ERA against Arizona in eight appearances, two starts. ... RHP Jason Marquis will make his first start for Arizona. He threw a five-hit shutout against the Giants while with the Washington Nationals this year. He's 5-3 with a 2.47 ERA lifetime against SF. ... The five Giants currently on the disabled list have a combined .289 average against Marquis. Cabrera (.333) is best. Carlos Beltran is at .150. ... OF Cody Ross made his second straight start as the leadoff hitter. Giants manager Bruce Bochy said he's one of several candidates to lead off. ... Diamondbacks C Miguel Montero has reached base safely in his last 14 games.