The Diamondbacks built a seven-run lead through five innings and boosted the advantage to nine heading into the eighth before the Astros put on a belated surge.
Upton's homer, his eighth of the year, gave Arizona a 4-2 lead in the third. After Upton's walk in the fifth forced in a run, Miguel Montero drove in two more with a single. Paul Goldschmidt had an RBI double later in the inning and he then scored on a single by starting pitcher Trevor Cahill.
Arizona added four runs in the seventh, two of them coming in on a single by Stephen Drew.
Cahill (8-8) went 5 1/3 innings to get the win, allowing three runs on nine hits.
Bud Norris (5-8) struck out seven in 4 1/3 innings, but surrendered six hits and walked five while giving up nine runs in taking the loss.
Both teams had 14 hits