With the win, the D-backs earned a split of the four-game series and pulled to within a half game of the first-place Dodgers in the National League West.
Hill, who was on the disabled list from April 15 to June 25 with a fracture in his left hand, came into the game mired in a 4-for-31 skid, but it didn't take long for him to snap out of it.
After Adam Eaton led off the bottom of the first with a walk Hill followed with a double to left to give the D-backs a 1-0 lead.
Hill hates to take one day off much less two, and he was asked after the game if the break had helped him.
"You don't want to ask me that," Hill said with a laugh. "I felt good, obviously."
In the fourth, back-to-back doubles by Wil Nieves and Cliff Pennington pushed the D-backs advantage to 2-0.
Hill was back at it in the fifth as he blasted a first-pitch hanging breaking ball from Carlos Villanueva (2-7) into the left field bleachers for a 3-0 Arizona lead.
"I don't know, but he swung the bat good," Gibson said when asked if the two days off helped Hill. "He got some balls and he drove one of them out of the ballpark. Hopefully his confidence is [up and] he feels much better at the plate."
Miley (7-8) continued his positive stretch of starts, though, it seemed he might not make it out of the third inning.
With one out in that frame, Welington Castillo hit a sharp grounder back up the middle that struck Miley in the right leg.
Miley appeared to be a great deal of pain, but after a few warmup tosses under the watchful eyes of pitching coach Charles Nagy and head athletic trainer Ken Crenshaw, he remained in the game.
"I knew it hit me somewhere on the knee I just didn't know where," Miley said. "It was hurting, but I didn't think I was going to come out. You've got adrenaline, you don't really feel it too much out there. Just try to go after guys and keep us in the ballgame."
While at times he limped, the blow to his leg did not impair Miley on the mound as he held the Cubs scoreless through the first six innings.
The Cubs managed to get on the board in the seventh when Castillo doubled home Cole Gillespie.
Miley allowed five hits over 7 2/3 innings. He walked three and struck out four.
"Miley pitched a good game, he kept the ball down -- he sinks the ball and all his offspeed stuff was really good," Cubs manager Dale Sveum said. "We held them to seven hits and three runs. That's a pretty good job. Other than that, we didn't get much going."
While Miley was setting down the Cubs, his performance inspired his teammates.
"I think what set the tone was Wade," Hill said. "Even after he gets drilled in the leg to see him competing and going out there pitch by pitch and doing his thing that builds momentum for a team. I know he's tough, but it hit him pretty square. Tough old country boy."
Miley suffered through a dismal May in which he went 1-5 with a 7.34 ERA. During his final start that month after he allowed seven runs in the first three innings against the Cubs at Wrigley Field, Pennington talked to him in the dugout.
"He kind of got on me a little bit," Miley said. "We have a good relationship so it was good he came over there. I needed that at that point in time and he was able to pull me up a little bit. Just kind of got my head right."
Since that time, Miley is 4-3 with a 2.68 ERA.
"We just have some talks, just trying to stay focused on what you can control and what's ahead of you not what's behind," Pennington said. "He's been doing a great job and been throwing the way we need him to throw."