Updated

PHOENIX -- Chris Herrmann hit a game-ending RBI single in the 10th inning, and the Arizona Diamondbacks rallied to beat the St. Louis Cardinals 6-5 on Tuesday night.

The surging Diamondbacks scored two in the eighth and one in the ninth to force extra innings. They have won four in a row and 13 of 15.

Rey Fuentes opened the Arizona 10th with a single and advanced on a sacrifice by pinch-hitting pitcher Zack Godley. Herrmann singled off Matt Bowman (1-3).

Diamondbacks closer Fernando Rodney (2-2) pitched a 1-2-3 10th inning for the win.

Carlos Martinez struck out 10 while pitching six sharp innings, and the Cardinals used throwing errors by catcher Chris Iannetta, pitcher Taijuan Walker and shortstop Nick Ahmed to open a 5-2 lead in the seventh.

With no outs and the bases loaded, Stephen Piscotty singled sharply off the leg of Walker to break a 2-2 tie. Jedd Gyorko added a sacrifice fly, and Ahmed bobbled the relay on Yadier Molina's long single to allow Tommy Pham to score the inning's third run.

Arizona responded with two in the eighth. Daniel Descalso singled in Jake Lamb and came around to score on Herrman's sacrifice fly.

David Peralta then led off the bottom of the ninth with a home run off Cardinals closer Seung Hwan Oh, tying it at 5.

Martinez allowed two runs on Iannetta's two-run double with two out in the sixth. He surrendered four hits and walked three.

Walker was charged with five runs, three earned, and six hits in 6 1 /3 innings. He had no strikeouts and walked five.

FEEL THE GLOVE

Pham robbed Iannetta of extra bases with a catch against the wall in center field in the second. Randall Grichuk made a diving grab on Herrmann's pinch-hit liner to left in the eighth.

SOME CONCERN

Ahmed departed after he was hit on his right hand by a pitch from Trevor Rosenthal in the eighth.

SHIPLEY COMES IN

The Diamondbacks called up right-hander Braden Shipley from Triple-A Reno. Shipley pitched a scoreless inning against the Cardinals.

Shipley will serve as a long man in Arizona's bullpen for the short term. He also has started twice this season for the Diamondbacks.

Shipley takes the roster spot of reliever Silvino Bracho, who was sent down following Monday's game.

UP NEXT

Cardinals: Adam Wainwright (7-5) is scheduled to start Wednesday. He is 7-4 in 13 career appearances against Arizona, with a 2.71 ERA.

Diamondbacks: RHP Godley faces the Cardinals for the first time in his career. He has not allowed more than three runs in any of his nine starts this season and is 3-1 with a 2.53 ERA overall.