AP Sports Writer
LOS ANGELES (AP) -- The Los Angeles Dodgers are closing in on clinching the NL West title just as the rival San Francisco Giants are coming to town.
The Dodgers lost 4-1 to Arizona on Wednesday night, leaving their magic number at six and their lead at 12 games over the Diamondbacks.
Los Angeles will start Zack Greinke and Clayton Kershaw in the first two games against the Giants.
"They'd like nothing more than to spoil anything that we're trying to accomplish," A.J. Ellis said of the defending World Series champions.
The Dodgers would like to clinch before the homestand ends Sunday.
"The fan support this year has been unbelievable, and they've really been energizing us," he said. "We've had so many full houses here that have carried us through some of these dramatic victories we've had late in the game. If we can finish this off this weekend, we'll be fortunate."
Paul Goldschmidt went 4 for 5 and drove in a pair of runs to help Arizona snap a five-game skid against the Dodgers.
Hyun-Jin Ryu (13-6) gave up three runs and 10 hits -- his second-most this season -- while striking out one and walking none in his first start since Aug. 30. The left-hander missed his scheduled start last Friday because of a stiff back.
"For him to come back after a little bit of a layoff and get six strong innings in, that was a big performance by him," Ellis said.
Ryu has taken the loss in three of his last four starts. He pitched six innings or more for the 22nd time this season, but he allowed double-digit hits for the third time in 27 starts.
Los Angeles got its only run on Yasiel Puig's 16th homer, a towering shot into the Dodgers' bullpen in left, in the seventh.
Patrick Corbin (14-6) ended a three-game losing streak while improving to 2-0 in three starts at Dodger Stadium. The left-hander allowed one run and eight hits in 6 1-3 innings, striking out two and walking two.
Brad Ziegler pitched the ninth to earn his 10th save in 12 chances.
Willie Bloomquist was 3 for 5 with a run scored for Arizona. A.J. Pollock and Tuffy Gosewisch both were 2 for 4 with a run scored.
Arizona took a 2-0 lead in the first on Goldschmidt's RBI single, the third in a row given up by Ryu to open the game, and Martin Prado's double-play groundout.
Gosewisch's RBI double in the second made it 3-0.
Goldschmidt's RBI single off Brian Wilson in the seventh scored Gosewisch, who doubled off Brandon League, extending Arizona's lead to 4-0.
Notes: Puig's homers are the most for a Dodgers rookie since Raul Mondesi had 16 in 1994. ... The Dodgers turned four double plays. ... The Dodgers selected the contract of LHP Onelki Garcia from Triple-A Albuquerque and transferred RHP Shawn Tolleson to the 60-day DL. Garcia, who made his major league debut in the ninth, is expected to provide extra protection in the bullpen for leftys Paco Rodriguez and J.P. Howell. ... Garcia is the first Dodger to don the No. 98 jersey since club began wearing uniform numbers in 1932. ... The 12th anniversary of the 9/11 attacks was marked by a moment of silence, a helicopter flyover and first responders lined up on the first and third base lines during pre-game ceremonies.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.