Updated

Jed Lowrie went 2-for-4 with an RBI and two runs scored as the Houston Astros snapped a nine-game losing streak with a 6-3 win over the Milwaukee Brewers in the second of three games.

J.D. Martinez was 3-for-4 with a run scored, while Jason Castro added two RBI for the Astros, who last won a game on June 27 against San Diego. Wandy Rodriguez (7-6) went 5 1/3 innings in the win, giving up two unearned runs on four hits with two walks and five strikeouts.

"There's a lot of good things that happened today and Wandy came out of the chute throwing the ball extremely well," said Astros manager Brad Mills. "It was very good to see him pitch like that today."

Cody Ransom drove in a run while Aramis Ramirez went 2-for-4 with a run scored for the Brewers, who had won five of seven coming in.

Zack Greinke (9-3) started the game for Milwaukee, but threw only four pitches before getting ejected. It was his first loss since May 26, as he went 4-0 over his seven previous starts.

Houston got a leadoff triple from Jordan Schafer to start the first and Jose Altuve followed with an infield single to first. On the play, Greinke raced over to cover the bag and spiked the ball when Altuve was called safe. First base umpire Sam Holbrook quickly ejected the pitcher and then tossed Milwaukee manager Ron Roenicke after he came out to argue the call.

"I don't blame the umpire for what he did," said Greinke. "I didn't mean it towards him and I shouldn't have done that. I didn't think about it at the time and didn't thing there was anything wrong with it."

The Astros plated three more in the third starting on Scott Moore's leadoff homer. After Martinez singled, Lowrie brought him home with a double and Lowrie scored two batters later on a sacrifice fly from Castro.

In the fourth, the Astros made it a 5-0 game. Schafer led off with a single and quickly stole second. After Altuve walked, a fly out from Moore moved Schafer to third. A bad throw from Martin Maldonado on an Altuve steal allowed Schafer to come home.

Castro's sacrifice fly in the fifth plated Lowrie, who had moved to third on a double from Chris Johnson after getting on base with a single, for a 6-0 lead.

Milwaukee got on the board in the sixth inning as a Moore misplayed a grounder to third that allowed Ryan Braun to score and a wild pitch later in the inning from Fernando Rodriguez led to Ramirez coming home to make it a 6-2 game.

Ransom's pinch-hit, RBI double in the eighth proved to be the final run as Brett Myers shut the Brewers down in order in the ninth for his 18th save of the season.

Game Notes

Milwaukee used seven pitchers in the game, including Randy Wolf, who made a relief appearance for the first time since July 8, 2001 when he was with the Phillies...Milwaukee outfielder Norichika Aoki went 1-for-5 to extend his hitting streak to 14 games...Houston has now won four of the seven games with Milwaukee this season...The Brewers left 10 men on base and went 1-for-9 with runners in scoring position.