Jordan Pacheco had hit a two-run double in the top of the eighth to give the Rockies a 3-2 lead.
Rafael Betancourt (1-4) blew his second save in as many nights.
John McDonald hit a one-out single to left and Gerardo Parra singled to left one out later. Hill then drove the first pitch he saw into the left-field stands for his 26th home run of the season.
Brad Ziegler (6-1) pitched the ninth for the victory.
The two starters, Jhoulys Chacin for Colorado and Patrick Corbin for Arizona, allowed only one run between them before turning things over the bullpens.
McDonald hit a two-run home run off Guillermo Moscoso in the seventh to give the Diamondbacks a 2-1 lead.
But Colorado came right back in the eighth.
Josh Rutledge led off with a single to left off David Hernandez. Tyler Colvin doubled to left and Pacheco lined the first pitch he saw down the left-field line, scoring both runners for the 3-2 lead.
Chacin was nearly untouchable before falling victim to the Rockies' 75-pitch limit on their starting pitchers. The right-hander gave up three hits in five scoreless innings, throwing exactly 75 pitches, while striking out four and walking two.
Corbin pitched into trouble only once and it translated into the Rockies' first
Andrew Brown led off the second with a single and advanced to third when Parra bobbled DJ LeMahieu's single to center. Corbin induced Charlie Blackmon to ground into a double play, allowing Brown to score for the 1-0 lead.
After Jonathan Herrera followed the double play with a double to left, Corbin settled down to retire 12 straight hitters and 16 of the final 19 he faced.
Corbin went seven innings and allowed one run on six hits. The rookie left-hander struck out six and issued an intentional walk.
The Diamondbacks took their first lead in the seventh. Jason Kubel doubled off the base of the right-field. Chris Johnson grounded out to third but McDonald followed with a towering home run into the back of the Diamondbacks' left-field bullpen for his sixth home run, matching a career high set in 2010.
NOTES: Kubel's double made him the seventh player in franchise history to hit 30 home runs and 30 doubles. ... Corbin has allowed only three unintentional walks in his past six starts spanning 26 1-3 innings. ... The Rockies came into the game with only four of seven players on the bench healthy enough to play. ... Diamondbacks C Miguel Montero singled in the fourth for his career high 139th hit of the season. ... RHP Ian Kennedy (15-11) closes out the season for the Diamondbacks on Wednesday against Rockies LHP Jeff Francis (5-6). Kennedy is 4-0 with a 3.00 ERA in his past six starts but walked six batters, the second-most of his career, in his last start Friday against Chicago. Francis is 8-7 in 23 career starts versus the Diamondbacks.