Hill entered the game in a 4-for-31 slump over his previous eight games.
Miley (7-8) worked 7 2-3 innings and didn't give up a run until the seventh. He allowed only five hits and struck out four despite being hit in his right knee with a batted ball in the third inning.
"You got adrenaline. You don't really feel it too much out there," Miley said. "I was just trying to go after guys and keep us in the ball game."
Miley forced two broken bats in his last inning. He left to a standing ovation with a runner on third base in the top of the eighth.
Back-to-back, ground-rule doubles by Wil Nieves and Cliff Pennington gave Arizona a 2-0 lead. Pennington's hit was just out of the reach of Gillespie.
Diamondbacks third baseman Martin Prado was shaken up when he slid headfirst into second base on a hustle double. Cubs shortstop Starlin Castro's leg jostled Prado's head as Castro came down from midair.
Prado remained in the game.
Brad Ziegler, who only since the All-Star break has been the Diamondbacks' regular closer, picked up his fifth save of the season with a scoreless ninth inning. But that inning included a ground-rule double for Nate Schierholtz after a fan reached over the yellow line above center field and caught the ball.
Fan interference was called, and the Cubs couldn't push across any runs.
Carlos Villanueva (2-7) took the loss after lasting five innings and allowing three runs and six hits.
"I had a rough first inning with the pitch count," said Villanueva, who also spoke of Soriano's departure.
"You are impacted from a personal standpoint because he is a guy that has been here for a number of years and everyone loves him here," Villanueva said. "A lot of the guys got very emotional and with a good reason.