Martin Prado got what proved to be the game-winning RBI and Nick Evans added a three-run homer to seal it, but the real key to the game was the performance of the Arizona bullpen.
Josh Collmenter endured the worst start of his big league career as he was unable to get the final out in the third inning and departed with the D-backs down, 6-2.
Relievers Eury De La Rosa, Oliver Perez, Matt Stites, Brad Ziegler, Evan Marshall and Addison Reed then combined to toss 7 1/3 scoreless innings while the offense managed to rally.
"Good battle," D-backs manager Kirk Gibson said. "The guys stayed plugging along and great contributions from everybody. [Collmenter] didn't have it. I stayed with him as long as I could. The bullpen was just great -- 7 1/3 innings of no-run ball, that was awesome. It was a great battle for us."
Prado had a big night at the plate, going 3-for-4 with five RBIs and finished a triple shy of hitting for the cycle.
"I'm not fast enough to get a triple here," Prado joked.
Everyone was in good spirits in the Arizona clubhouse after the 10-inning rally.
Ender Inciarte reached on a bunt single with one out in the 10th, moved to third on a double by Didi Gregorius and scored on Prado's shallow fly to center off reliever Antonio Bastardo.
"He threw a slider first pitch for a ball," Prado said. "I thought they didn't want to walk me because they'd have to face the best hitter [Paul Goldschmidt] on our team. Then he threw a fastball outside. I knew he was trying to make good pitches to me. He actually made a good pitch inside, a fastball inside. I felt like I have to put the ball in play. It's not like I was looking for a fly ball, but fortunately for me we got a fly ball."
Later in the inning, Evans sealed it with a pinch-hit three-run homer.
That capped a surreal day for him as rumors earlier in the day had his contract being sold to the Rakuten Golden Eagles in Japan. While that may happen soon, Evans remains with the D-backs for now.
"It's been an interesting day so far," Evans said. "Just going up there in that situation after Martin drove in that run, it just kind of takes the pressure off knowing you've got the lead. So just looking for something I could hit hard and it carried out. That was really all there was to it. I'll still be here tomorrow, ready to go tomorrow."
It was the second straight rough outing for Bastardo, who allowed a grand slam in Friday's Phillies win.
"The last couple of nights it's been his slider that he got beat on," Phillies manager Ryne Sandberg said. "The home run tonight was a slider. He's showing good fastballs and getting beat with his slider."
After a slow start, Prado has been heating up of late, hitting .394 over his last nine games.
"Kid works hard all the time and he's getting better results, seeing the ball good," Gibson said of Prado. "When you get better results, you just relax a little more. We try to get him to quit beating himself up so much, but he just believes that the harder he works the better results he's going to have, and it's not always the case."
Marshall (3-2) picked up the win while Bastardo (4-4) took the loss.