PHOENIX — Hyun-Jin Ryu made one mistake and it cost him and the Dodgers.

Paul Goldschmidt hit a two-run home run in the first inning and Trevor Cahill and three relievers made it stand up in Arizona’s 2-1 win over Los Angeles on Monday night.

“We were fortunate but sometimes you have to win 2-1 with two hits,” Arizona manager Kirk Gibson said. “We got two hits but we made the most of them.”

It marked the third time in Diamondbacks history that they won with two or fewer hits.

With Los Angeles’ fourth loss in a row and the Diamondbacks third straight win, the Dodgers’ magic number to clinch the NL West remains four.

Los Angeles has lost 11 of 12 but the Dodgers’ once 13ƒ-game lead over Arizona only had shrunk to 9ƒ with 12 games to play.

“The last 11 are basically gone so they don’t concern me at all,” said Los Angeles manager Don Mattingly. “I can’t get those back even if I wanted to waste energy on trying to figure out what happened to those 11. It really goes into what I always think about September. It’s hard to win games and I don’t care who you are.”

Goldschmidt raised his NL-leading RBI total to 116 with his 33rd home run off Ryu (13-7). Goldschmidt has homered in each of his last two games after an 83-at-bat drought.

“He threw a fastball first pitch and I was looking for something over the plate,” Goldschmidt said. “(Ryu) pitched great.”

Ryu went the distance for his second complete game, allowing only the two runs on two hits in eight innings. He walked one, struck out four and retired 23 of the final 24 batters he faced.

“I threw 100 pitches but that one pitch was the decision-maker of the game,” Ryu said. “It was an error on my part. I believe no matter how good a pitch it was. If it is a home run, it’s a mistake.”

Cahill (7-10) won for the fourth straight decision, holding Los Angeles to one run on two hits over 5º innings.

Brad Ziegler pitched the ninth for his 11th save but not without some drama.

The Dodgers’ Michael Young hit a pinch-hit single to center and Skip Schumaker singled to left. Juan Uribe tried to bunt the runners over, but Ziegler fielded the ball and threw to third to force Young for the first out.

Nick Buss hit a soft bouncer to first for the second out as the runners advanced.

Mattingly then sent up Matt Kemp, who was activated off the 15-day disabled list earlier Monday. Ziegler got ahead 0-2 on two swinging strikes, wasted a pitch and then struck out Kemp on a lunging swing at on a curveball well low and outside.

“I’ve faced him a lot even before I got to Arizona, facing him in batting practice,” Ziegler said. “I know what he’d trying to do and he knows what he wants to do against me. Luckily, I came out on top tonight.”

Cahill was nearly untouchable over the first five innings, allowing only a single by Punto to start the game and a two-out walk to Puig in the first before retiring the next 13 in a row.