Jarrod Dyson hit a tying double in the eighth inning with the help of Chase Field's new artificial turf, David Peralta had a game-ending single in the 11th, and the Diamondbacks avoided a three-game sweep with a 3-2 victory Wednesday.
''We've been walking through some very lean times. We've been battling through some injuries,'' Diamondbacks manager Torey Lovullo said. ''It's one of those games that you feel like will push you in a very positive direction.''
The two-time defending NL champions entered with a season-high, seven-game winning streak and began the day 10 1/2 games ahead of second-place Colorado in the NL West and 13 games in front of the Diamondbacks. The Dodgers, an NL-best 43-20, lost for just the second time in 13 games.
Dyson's tying two-out double hit the lip of the artificial turf where it meets the grass and took a huge bounce over the glove of diving first baseman Max Muncy. Chase Field had grass from the ballpark's opening in 1998 through last year.
''We needed this win,'' Peralta said.
Zack Godley (2-4) pitched a perfect 11th for the Diamondbacks, who were outhit 7-5.
Will Smith hit a two-run homer in the third off Jon Duplantier, who allowed three hits over five innings with seven strikeouts in his second big league start.
Dodgers starter Kenta Maada gave up two hits in five innings and struck out seven. He retired his first nine batters before Dyson singled and scored on Peralta's double.
Maeda was unhappy with the decision to lift him.
''I was a 100 percent ready to go back out there and pitch another inning,'' Maeda said through a translator. ''As a starting pitcher only pitching 70 pitches and going five innings deep, it is not a very pleasant thing. Yes, I was surprised with the decision to take me out of the game. I was pretty confident I could get those guys out.''
Dodgers manager Dave Roberts said he wanted to go with a fresh bullpen that included Julio Urias, who had not pitched since Saturday.
''With Urias rested, a very heavy left-handed lineup, I just felt Kenta gave us what he had and a chance to win the baseball game,'' Roberts said.
Roberts was off to San Diego after Wednesday's game to see his son play in a baseball showcase. Roberts is expected to rejoin the Dodgers in time for Friday's game at San Francisco, with the team getting Thursday off.
THE BELLINGER SHIFT
Arizona deployed an exaggerated shift to the right side of the field with one strike or two on Cody Bellinger in four of his five at-bats, moving Marte from second base to right field and moving right fielder Tim Locastro closer to the foul line. Bellinger, whose .370 batting average leads the majors, dropped a single in front of Marte in the sixth inning but was retired in his other three turns at the plate with the shift.
Locastro, who scored on Dyson's double, has been hit by a pitch nine times in 31 major league games.
Dodgers: INF Matt Beaty was placed on the 10-day IL, retroactive to Wednesday, with a left hip flexor strain. OF Kyle Garlick was recalled from Triple-A Oklahoma City. ... C Austin Barnes, on a rehab assignment with Class A Rancho Cucamonga following a groin strain, could rejoin the Dodgers on Friday.
Diamondbacks: OF Adam Jones, who left Tuesday's game with hamstring tightness, got good news from his MRI Wednesday. He's day-to-day and could be ready to hit when the Diamondbacks take the field next in Toronto on Friday.
Dodgers: LHP Clayton Kershaw (5-0) is scheduled to start Friday's series opener at San Francisco. He is 22-10 against the Giants.
Diamondbacks: RHP Merrill Kelly (5-6) is slated to be on the mound Friday at Toronto.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports