BALTIMORE -- On a night when Baltimore struggled to get hits against Texas' young right-hander making his first major league start, the Orioles simply stayed patient and eventually broke through against the Rangers' bullpen.
The Rangers have lost eight consecutive road games, their longest drought since 2005.
Baltimore stayed within one game of first-place Toronto, which beat Milwaukee 7-4, earlier Wednesday. The Orioles (45-39) moved six games over .500, equaling a season-high.
"That was really impressive," Orioles manager Buck Showalter said. "That was one of the more impressive things I've seen, to be able to bring that intensity into a game like that. The whole group, I was real proud of them tonight."
The game was delayed 1 hour and 38 minutes because of rain in the bottom of the eighth inning.
Jones hit his 16th home run of the season and had three RBIs. Flaherty, who started at third base in place of the suspended Manny Machado, hit his fourth homer of the season and also made several nice defensive plays.
Baltimore has homered in 12 consecutive games.
Texas' Miles Mikolas was effective in his first major league start. He allowed three runs and three hits with four strikeouts and two walks over 5 1/3 innings.
Texas (37-47) has used 11 starting pitchers this year, most in the American League. The Rangers have lost 13 of their past 16 games.
"It was a lot of fun being out there," Mikolas said. "I thought I pitched a pretty good game up until the fifth. Then, I had some trouble with some walks. Things kind of didn't go our way after that."
Staked to a 4-1 lead, Mikolas walked Nick Markakis and Steve Pearce with one out in the sixth. Jason Frasor entered and allowed a sacrifice fly to Jones and an RBI single to Nelson Cruz. He then walked Chris Davis before allowing a game-tying RBI single to J.J. Hardy.
Flaherty provided the Orioles with their first lead, 5-4, hammering an offering from Neal Cotts (2-5) onto the flag court behind right field to lead off the seventh. Jones added an insurance run that inning with a two-out single.
"It's sum of the parts for sure," Flaherty said. "It can't be the same guys every night. And it's an opportunity for other guys to get in there and try to contribute and help the team win."
After winning his previous two starts, Baltimore right hander Chris Tillman struggled most of the game. He allowed four runs -- three earned -- and seven hits with two strikeouts and four walks over 5 2/3 innings.
Texas took a 1-0 lead in the first on a two-out RBI single by Alex Rios. In 18 starts, Tillman has given up 16 runs in the first inning.
"It was a grind," Tillman said. "It wasn't good. I made some pitches when I had to. I had some stuff. I was consistently behind in the count. You have to make pitches on a consistent basis."
Cruz, who leads the majors with 26 homers, appeared to tie the game with a towering shot in the bottom half of that inning before Leonys Martin made a leaping catch over the fence in center field.
"That was awesome," Rangers manager Ron Washington said. "He beat the ball to the fence, timed it perfectly and brought it back. Nelson can just swipe the ball in this ballpark and it will go a long ways."
The Rangers added three runs in the next inning on a two-run double by Adrian Beltre and a run-scoring grounder by Rios that bounced of Tillman's lower leg.
Jones' homer in the fourth pulled the Orioles within 4-1.
Baltimore RHP Bud Norris (right groin strain) threw a bullpen session Wednesday and will throw again Friday. Norris, who is eligible to come off the DL July 7, likely will need a rehab start or simulated game before rejoining the rotation, Showalter said. ... Orioles RHP Suk-min Yoon, who is on the minor league DL, received a cortisone injection in his right shoulder to reduce inflammation and will be reevaluated after being shut down for a few days. ... Davis hit off the tee before the game with Showalter observing. He went 1 for 3, snapping an 0-for-21 skid with a single in the eighth. ... The Orioles will try to sweep the four-game series when LHP Wei Yin Chen (7-3, 4.19 ERA) faces Rangers RHP Yu Darvish (8-4, 2.42) on Thursday.