Altuve's run-scoring single in the first inning put the Astros ahead to stay and Moore's solo shot in the third triggered a three-run outburst that carried Houston to its first win since June 27.
J.D. Martinez added three hits and a run scored, while Jed Lowrie contributed an RBI double for the winners.
Wandy Rodriguez (7-6) allowed two unearned runs over 5 1/3 innings to collect the victory, issuing two walks and striking out five.
Brewers starter Zack Greinke (9-3) was tagged with the loss and ejected from the game before recording an out. After center fielder Carlos Gomez misplayed Jordan Schafer's hit into a lead-off triple, Schafer scored on Altuve's grounder to the pitcher.
Greinke believed he beat Altuve to first base and spiked the ball in frustration when umpire Sam Holbrook ruled against him, earning an ejection just four pitches into the game. Brewers Manager Ron Roenicke was also tossed for arguing the call.
Rickie Weeks and Cody Ramson drove in runs for Milwaukee.