HOUSTON — The Orioles' offense didn't exactly erupt against the Houston Astros on Saturday afternoon, but it was productive enough to finally scrape out a much-needed win three days into their trip to Texas.

These Orioles have drawn their share of criticism for being overly aggressive at the plate, complaints only compounded by two frustrating games here in which they scored just one run each night. But this time, they allowed patience to guide them to victory.

They received their third straight quality start and this time took advantage of a well-timed strong outing from struggling ace Chris Tillman in a 4-1 win over the Astros before an announced 29,609 at Minute Maid Park.

The Orioles (27-27) took advantage of Astros left-hander Dallas Keuchel's sudden control problems, scoring two runs on a pair of bases-loaded walks in the fifth inning.

The win ended the Orioles' season-high four-game losing streak and brought them back to .500 after a May skid in which they lost 13 of their past 19 games.

Designated hitter Nelson Cruz continued to carry the offense, hitting his major league-leading 20th homer in the eighth inning and driving in three runs.

Tillman found his groove, holding Houston to one run on four hits over 62/3 for his first win since May 16.

“I think we needed it, not just him,” Orioles manager Buck Showalter said. “You know, very quietly, as much as we keep talking about some of the quality pitching against us, our guys have pitched pretty well. And you've got to do it, as good as [Houston's] starters are.”

Tillman's start followed quality starts from right-handers Ubaldo Jimenez and Miguel Gonzalez over the series' first two nights. This time, the Orioles were able to take advantage.

“I think we are kind of feeding off each other, kind of getting this thing going a little bit,” Tillman said. “I think it's a part of the game, the friendly competition that we always talk about. These guys went out and set the tone early. I have to follow suit.”

Tillman (5-2), who had allowed 14 earned runs over his previous two starts, recorded his fifth quality start in 12 outings this season Saturday.

Cruz's three-RBI day gave him 52 this season, passing Chris Davis' previous club record of 50 RBIs by the end of May, set last season.

In 30 May games, Cruz hit .339 (39-for-115) with 13 home runs and 27 RBIs. He has five homers in his past seven games and has driven in five of the Orioles' past nine runs.

“As a team, we know we can score runs, no doubt,” Cruz said. “We have, top to bottom, one of the best lineups in the league. It was a matter of time before we came back and do what we're supposed to do. Today was a great example. We had a chance to tie the game and go on top again. We got walked a few times. ... As a team, we like to swing. We need to walk; that's the way we should do it.”

The Orioles had drawn one walk over a span of 28 innings before Keuchel issued three free passes in the fifth, the last two with the bases loaded.

“I'll say it again: You can't take until you hit. There's a fine line between it. You know the guy's going to be around the plate. He makes a living out of having a pitch appear in the middle of the plate and take you off the sweet part of the bat,” Showalter said. “We've had a lot of weak contact off their pitchers and not a whole lot of strikeouts, but that's [why] quality pitching is what it is.”

Keuchel (6-3) entered the day having won his past four starts, including two complete games in which he allowed no earned runs, but he quickly ran into trouble in the fifth.

Manny Machado, who had just one hit in his past 19 at-bats, beat out an infield single to third base with one out in the inning, and two batters later, catcher Caleb Joseph looped a single to right field that dropped just in front of right fielder George Springer, sending Machado to third.

After Nick Markakis drew a walk to load the bases, the first run of the inning scored on a five-pitch walk to Steve Pearce. Cruz then drew a eight-pitch, full-count walk that scored another run.

Markakis opened the game with a leadoff double to left field, moved to third on a groundout by Steve Pearce, then scored on Cruz's sacrifice fly to center.