SAN FRANCISCO -- When the San Francisco Giants intentionally walked Adam Jones in a tie game on Friday night to face major-league RBI leader Chris Davis, both managers thought it was the right thing to do.
Turns out they were both wrong.
Facing Javier Lopez in a lefty-lefty matchup that Giants manager Bruce Bochy dictated, Davis smacked a two-out, two-run double in the top of the 10th inning, highlighting a three-run uprising that gave the Baltimore Orioles a 5-2 victory.
The Orioles rallied for a third straight win to open their eight-game road trip after Hunter Pence had singled in Brandon Belt in the bottom of the ninth off Orioles closer Jim Johnson to rally the Giants into a 2-2 tie.
"To battle back and win is huge," said Davis, whose RBIs were his 107th and 108th of the season. "These kinds of games are what playoff games are going to be like."
Manny Machado's second double of the game, a one-hopper off the glove of Giants shortstop Brandon Crawford with one out in the 10th, ignited the winning inning.
After Lopez (1-2) got Nick Markakis on a comebacker for the second out, the Giants opted to walk the right-handed-hitting Jones, who had two earlier hits, and face the lefty-swinging Davis.
"I had the right guy out there," Bochy said. "You like lefty against lefty. That's a good matchup. And you get a fly ball. We just couldn't get to it."
Davis wasn't sure his high fly to right-center field would fall between Giants center fielder Gregor Blanco and Pence in right.
"When I first hit it, I thought it might hang up," Davis said. "I was happy to see it drop. That's a tough matchup."
Orioles manager Buck Showalter said he wasn't surprised to see Bochy go after Davis.
"Lopez is one of the best left-on-left pitchers in baseball," Showalter said. "We're just fortunate Chris just put a good swing on it."
Matt Wieters followed with a single to center to score Davis, increasing the Baltimore lead to 5-2.
Despite his seventh blown save of the season, Johnson (3-7) got the win. Tommy Hunter pitched a scoreless bottom of the 10th for his third save.
"I remember a game like this last year in Boston," Johnson said, putting a positive spin on his personal failure. "We blew a lead and came right back in our first at-bat to win it. Then we went on a nice run.
"Hopefully, this gives us momentum for the series. That's the way I look at it."
The Orioles appeared headed for a regulation win after Chris Tillman held the Giants to one run and four hits in eight innings. But Johnson, the major-league leader in saves with 39, couldn't close the door in the ninth.
Pence singled in Belt, who earlier had homered, to tie the score as the first three Giants to face Johnson got on base.
San Francisco eventually got Buster Posey, who represented the potential winning run, to third base with out one. But Johnson struck out Roger Kieschnick and got Blanco on a soft liner to second base to force extra innings.
Neither starting pitcher factored in the decision.
Tillman had been pursuing a fifth consecutive interleague win and his 11th victory overall in his last 12 outings. He gave up a two-out home run to Belt in the sixth, but only one other Giant advanced as far as second base against him.
The right-hander struck out a career-best nine and walked just one.
The Giants' Ryan Vogelsong was making his first start since breaking bones in and below his right pinkie finger while batting in a game against Washington on May 20.
He pitched effectively through the sixth inning after the Orioles had scored single runs in each of the first two innings. J.J. Hardy produced the second-inning run with a home run, his 20th of the season.
Vogelsong held the Orioles to two runs and six hits. He walked three and struck out four.
NOTES: Tillman's only previous interleague road start also was at San Francisco on June 14, 2010. He lasted only two innings in that outing, allowing six runs. ... Hardy has hit 20 or more home runs in each of the last three seasons. The last Orioles shortstop to accomplish that feat was Miguel Tejada from 2004 to 2006. Before that, Cal Ripken Jr. did it 10 straight years (1982-91). ... No major-league shortstop other than Hardy hit at least 20 homers in each of the past two seasons. ... Machado's two doubles were his third and fourth since July 1. He had 38 in the first three months of the season and still leads the American League. ... The Giants optioned reliever RHP Jean Machi to Triple-A Fresno on Friday to make room for Vogelsong on the active roster. ... Vogelsong entered the game with a 3-0 record and 0.65 ERA in four career home interleague starts.