Astros ace Justin Verlander allowed four hits and six shutout innings in the 4-1 triumph, earning his 19th win of the season Tuesday in Houston.
"We've played with a sense of urgency even when others have told us we don't have to," Astros manager A.J. Hinch told reporters.
"We're trying to win as many games as we can. What comes with that is going to be great. Obviously, we want to win the division first. It's something we've talked about all year. Then we'll get to whatever's next for us."
Yuli Gurriel hit his 29th homer of the season in the fifth frame, giving the Astros a 1-0 lead. Bregman stepped up to the plate as the Astros' third hitter in the bottom of the sixth frame. The All-Star second baseman settled in against Rangers starter Lance Lynn during the exchange.
Lynn got a called strike on his first pitch, before Bregman belted his second offering over the left field fence for his 37th homer of the season. The 387-foot shot had an exit velocity of 103 mph and left the field in six seconds, according to Statcast.
Lynn began his exchange with Alvarez by issuing three consecutive balls. Alvarez took a called strike and fouled off two Lynn offerings before smashing a 3-2 fastball over the center field fence for his 26th homer of the season. The 454-foot solo shot had an exit velocity of 112 mph and left the field in 5.8 seconds.
Nomar Mazara hit a solo homer for the Rangers in the top of the seventh inning. Astros slugger George Springer brought in the final run of the game with an RBI single in the bottom of the seventh frame.
Lynn allowed seven hits and four runs in seven innings. Roberto Ozuna picked up his 34th save of the season for the Astros.
The Astros host the Rangers in the final game of the series at 8:10 p.m. EDT Wednesday in Houston.