LOS ANGELES (AP)  — David Peralta hit a three-run homer in the fifth inning and the NL West-leading Arizona Diamondbacks defeated the Los Angeles Dodgers 3-1 on Thursday night in the opener of a pivotal series.

The loss snapped the Dodgers’ five-game winning streak, which they had put together against last-place San Diego and Texas. They struck out 15 times, including four by Chris Taylor.

READ MORE: Angels Reportedly Re-Sign Closer Raisel Iglesias To Four-Year Deal

The teams were playing each other for the first time since May 9. Arizona leads the season series 9-4.

Robbie Ray (4-2) gave up one run and four hits in 5 1/3 innings. He struck out nine and walked two to earn his first victory since June 23 at Miami. The left-hander hadn’t figured into a decision in seven consecutive starts since July 20, the longest streak in franchise history by a starter.

Brad Boxberger got the final two outs in the ninth to earn his 31st save in 37 chances. He struck out Taylor and got Yasiel Puig on a called third strike.

Peralta sent his 26th homer into right field on the first pitch from Rich Hill with two outs, giving Arizona a 3-0 lead.

Hill (6-5) allowed three runs and six hits in five innings. The left-hander struck out seven and walked none.

The Dodgers’ lone run came on Manny Machado’s 33rd homer in the sixth.

Dodgers reliever Caleb Ferguson pitched out of a bases-loaded jam in the eighth. After giving up three consecutive one-out singles, he struck out John Ryan Murphy and pinch-hitter Christian Walker lined out to right to end the inning.

READ MORE: Authorities Reveal Victim of Fatal 57 Freeway Crash In Fullerton On Monday

Los Angeles had the potential go-ahead run at the plate in the bottom of the inning, but Matt Kemp grounded into an inning-ending double play with runners on the corners.

TRAINER’S ROOM

D-backs: RHP Shelby Miller (right elbow tightness) will throw to 125 feet early next week. … OF Jarrod Dyson (right groin strain) is headed to Triple-A Reno for a rehab assignment.

Dodgers: Reinstated RHP Josh Fields (right shoulder inflammation) from 60-day DL.

UP NEXT

RHP Zack Greinke (13-8, 2.93 ERA) goes for the D-backs. He is 3-1 with a 3.09 ERA in his last five starts against his former team. The Dodgers send LHP Hyun-Jin Ryu (4-1, 2.18) to the mound. He is 3-3 with a 3.90 ERA in 12 career starts against Arizona.

(@Copyright 2018. The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)

MORE NEWS: Ducks Blow Late Three-Goal Lead, Beat Kings 5-4 In Shootout