Roberts' solo shot in the third inning was his first homer at Camden yards since Opening Day of 2011.
The Orioles (51-42) have now hit a majors-leading 125 homers this season.
Bolstered by back-to-back quality start by Wei-Yin Chen on Wednesday and Gonzalez on Thursday, the Orioles earned a split of the four-game series against the Rangers (53-39). They needed it to keep pace with American League East-leading Boston Red Sox — as well as the Tampa Bay Rays and New York Yankees — who won earlier in the day.
"We're hopeful that five guys we run out there are going to give us a chance and make our bullpen better, shorten up some of the outs we have to get out of the bullpen," Showalter said of his starting rotation. "Miggy was solid. He was carrying a little more fastball tonight — a little late life."
The Orioles head into their final series before the All-Star break — a three-game set against the Toronto Blue Jays that begins Friday night — 5 ½ games behind the Red Sox and one game behind the Rays for second place. The Yankees are just a half game behind the Orioles.
Gonzalez (7-3) retired 13 of the first 14 batters he faced Thursday. Gonzalez worked ahead of hitters — he threw 17 of 25 first-pitch strikes — and even though he didn't have his split-fingered fastball, Gonzalez relied on his two-seam fastball to keep the Rangers off balance and get eight ground-ball outs. He recorded his 12th outing of six or more innings in 16 starts this season.
"Buck likes that," Gonzalez said. "He wants us to go out there and try and do our best and go deep in the games, and that's what I've been trying to do every time out there."
Gonzalez held the heart of Texas' batting order — hitters No. 2 through No. 5 — to one hit in 12 at-bats.
"He's a guy that we all know how special he is and how good he can be, and he proved that tonight," Davis said. "He threw the ball really well. He was around the zone, and when a guy is getting ahead of you first-strike, it makes it tough on you, so I was proud of him to go as long as he did and do as well as he did."
Gonzalez's only costly mistake was a leadoff homer by Ian Kinsler in the sixth. He left the game after issuing a two-out walk to Jurickson Profar in the seventh on his 104th pitch. Lefty Troy Patton came in and struck out David Murphy to end the inning.
Gonzalez said the pregame back spasms, which he said haven't been a problem in the past, faded when he started warming up.
"It just happened today, 30 minutes before the game," Gonzalez said. "As soon as I started warming up, I felt better, and it loosened up afterward. I wasn't worried about it. I told them myself, I'm ready to go. I'm ready to go. I want to be out there and I want to go make my pitches and give my team a chance to win."
Early on, the Orioles looked like they were in for a big offensive night against spot starter Ross Wolf, a former member of their minor league system.
Davis — whose previous hit was a two-run homer Saturday at Yankee Stadium — took an 85-mph changeup on a 2-1 count out of the park with one out in the second inning.
Roberts led off the third inning with his homer, which came on a 1-0 fastball that sat waist high and split the plate, giving the Orioles a 2-0 lead. It was his second homer of the season.
But Wolf (1-2) — filling in for the injured Yu Darvish — gave up just one hit after that, giving an injury-plagued Rangers rotation six innings. He struck out three and walked one.
Darren O'Day preserved a one-run lead in the eighth after the Rangers placed the tying run on second with no outs.
After Patton allowed a leadoff single to Leonys Martin, a pickoff throw to first from O'Day got past Davis, sending Martin to second. But Martin wouldn't get any further as O'Day induced a ground out in front of the plate from Kinsler and got a pop up and fly out to end the inning.
The Orioles added a run in the bottom of the eighth on Nate McLouth's two-out RBI single off Jason Frasor, extending the lead to 3-1.
Jim Johnson converted his AL-leading 31st save despite allowing a leadoff single to Adrian Beltre in the bottom of the ninth. Johnson then fielded a comebacker from A.J. Pierzynski and started a 1-6-3 double play. Two batters later, Johnson induced a game-inning grounder to first.