HOUSTON (AP) -- Brad Mills breezed into the post-game interview room after Saturday's game with a huge grin planted on his face.
''It's nice to come in here with a smile,'' the Houston manager said after watching his team break a season-long nine-game losing streak with a 6-3 win over the Milwaukee Brewers.
Scott Moore homered for the second straight day and J.D. Martinez and Jose Altuve had three hits each as the Astros took advantage of the first-inning ejection of Zack Greinke to get the victory.
''He's a Cy Young winner and to be able get him out of there and face their bullpen, that really helps you,'' Houston's Jordan Schafer said.
Greinke (9-3) entered the game looking for his 10th win; instead he was gone after four pitches - ejected after spiking the ball following a close play at first base.
Manager Ron Roenicke was also tossed for arguing the call and the Brewers were forced to piece together the game with six relievers.
''When that happens to a starting pitcher, especially one as good as Zack, it changes how you feel about that game,'' Roenicke said. ''When we get behind like we did, it's hard to bounce back.''
Greinke, who was ejected for the fourth time in his career, called the incident a mental mistake.
''I didn't think there was anything wrong with it at the time, but after looking back at it, I thought: 'Oh, (man), that definitely didn't look good.' I put him in a bad position and he had to make a decision,'' Greinke said.
The bad news for the Astros is that Greinke could return to the mound on Sunday with the All-Star break coming up.
''We already talked to Zack. He thinks he would be fine, but we're not positive which way we're going to go,'' Roenicke said when asked about that possibility. ''We've got some more conversations to go through.''
The Astros were up 1-0 after the first inning and jumped on Livan Hernandez, who took over for Greinke, for three runs in the third.
Houston starter Wandy Rodriguez (7-6) yielded four hits and two runs - both unearned - with five strikeouts in 5 1-3 innings. Brett Myers pitched a perfect ninth for his 18th save.
Schafer and Jed Lowrie collected two hits apiece and Jason Castro drove in two runs as the Astros scored more runs than they had in the last three games combined to get their first win since June 27.
Things went wrong for Greinke immediately when Schafer took his first pitch to center field for a leadoff triple. Three pitches later it got much worse when he raced to cover first base on a grounder by Altuve and spiked the ball when the All-Star speedster was called safe, leading to his ejection by first base umpire Sam Holbrook.
Roenicke immediately raced out to argue the call and was ejected for the first time this season.
''He overreacted,'' Roenicke said of Holbrook, adding that the umpire said he thought Greinke was trying to show him up. ''He didn't even see what happened. Zack was behind him and he didn't even see him. You need to know; you need to know 100 percent what happens when you kick out a starting pitcher.''
Schafer scored on the play where the pair was ejected to put Houston up 1-0. The center fielder also made a couple of nice defensive plays on Saturday to bounce back from a tough week where he was pulled from a game after making two mistakes.
''He did a great job,'' Mills said. ''We know that he can do it and we know it's there ... he did a great job at the top of the order.''
Moore opened Houston's third inning with his homer to right field to make it 2-0 and give him three home runs in eight games since being called up from Triple-A Oklahoma City.
Martinez followed with a single before scoring on a double by Lowrie. Lowrie scored on a sacrifice fly by Castro later in the inning to push the lead to 4-0.
Schafer singled with one out in the fourth inning and picked up his 20th stolen base when he took second. Altuve walked before Schafer advanced to third on a flyout. He scored on an error by Martin Maldonado when the catcher overthrew second base trying to pick off Altuve.
Lowrie singled off Randy Wolf, a starter who was making his first relief appearance since 2001, to start the fifth. Chris Johnson doubled before Lowrie scored on a sacrifice fly by Castro to leave Houston up 6-0.
Rodriguez had retired 14 of his last 16 when Ryan Braun reached on an error by Moore with one out in the sixth inning. Aramis Ramirez singled and Corey Hart drew a walk to load the bases.
The Brewers got on the board thanks to another error by Moore, when he stopped a sharply hit grounder from Rickie Weeks, but dropped the ball before he stepped on third base. That allowed Weeks to reach, Braun to score and chased Rodriguez.
He was replaced by Fernando Rodriguez, who retired the next batter before Ramirez scored on a wild pitch to cut Houston's lead to 6-2. Moore capped off his rough inning by catching a fly ball by Cesar Izturis in foul territory to end the inning.
Cody Ransom added a run for the Brewers with an RBI double in the eighth inning.
NOTES: Milwaukee RF Norichika Aoki singled in the third inning to extend his hitting streak to 14 games. ... Houston OF Justin Maxwell, on the DL with an injured left ankle, went 1 for 2 with a double in a rehabilitation assignment with Oklahoma city on Friday night. ... These teams wrap up the series on Sunday when Milwaukee's Marco Estrada opposes right-hander Jordan Lyles.