Pence drove a pitch from Rodrigo Lopez over the right-field fence for his team-high 22nd homer of the season. Michael Bourn walked to lead off the game and Jeff Keppinger followed with a single before Pence's homer.
The hit was all the Astros needed from their offense on the day. Starter J.A. Happ (6-2) held the Diamondbacks to two runs on six hits over seven innings to get the win, his third straight as an Astro after coming over in a trade with Philadelphia for pitcher Roy Oswalt. Happ struck out seven and worked out of a jam in the seventh, striking out John Hester and pinch-hitter Ryan Roberts with runners on first and second and one out.
Hester, Arizona's backup catcher, hit his second home run of the season, a solo shot in the third. Kelly Johnson added his 20th home run in the fourth.
The Diamondbacks trailed by one and had runners on first and second with two out in the fifth when Stephen Drew singled deep in the hole at second base. The runner at second, Hester, attempted to score but was easily thrown out at home.
Lopez (5-13) settled down and worked six innings, not allowing a run after the first, but still hasn't won a game since July 8. Lopez leads the majors with 33 home runs allowed and 99 earned runs allowed.
Matt Lindstrom worked a scoreless eight and Brandon Lyon converted his 13th save in 14 opportunities for the Astros, winners of 11 of their past 14 games. Arizona had a runner in scoring position with less than two outs in each of the last three innings but failed to push a tying run across.
Notes: Diamondbacks third baseman Mark Reynolds came out of the game in the ninth inning after trying a few warmup throws. He was replaced by Augie Ojeda... Outfielder Justin Upton remains day-to-day after not being in the lineup Sunday because of left shoulder irritation. Upton has missed the past four games. Gerardo Parra has played right field in Upton's absence Astros RHP Felipe Paulino threw a two-inning, 43-pitch simulated game Saturday at Chase Field with no setback. He's on the 60-day disabled list with a right rotator cuff injury.
(This version CORRECTS Astros 3, Diamondbacks 2. Corrects Reynolds note to him taking warmup tosses before leaving game.)