BOSTON -- In danger of their second walk-off loss in three games, the Orioles got a lift from an unlikely hero.
Rarely used outfielder David Lough, a late-game defensive replacement who entered the game in the seventh inning, collected his first extra-base hit since June 7 and scored the go-ahead run in the top of the 12th inning to give the O's a 7-6 victory over the Red Sox on Sunday afternoon at Fenway Park.
The win, which went to right-handed reliever Brad Brach on the heels of three superb scoreless innings, saw Baltimore overcome a bullpen meltdown and improves the first-place O's (48-40) to 39-29 against Boston since the start of the 2011 season.
"That's the kind of game that good teams win," Orioles manager Buck Showalter said of his tired but resilient club after playing 30 innings in a two-day stretch. "I was thinking that in the dugout. It's so easy just to say, 'Boy it wasn't meant to be today,' instead of making it happen."
With the score knotted at 7, Lough -- who entered the day batting .191 in 60 games -- tripled off Red Sox reliever Edward Mujica and scored on J.J. Hardy's follow-up single. Lough also threw out David Ortiz trying to stretch a single in the bottom of the 12th.
The O's also got a big boost from Brach and catcher Caleb Joseph, who threw out Dustin Pedroia at second base to erase a one-out single in the bottom of the ninth. Umpire Hunter Wendelstedt first motioned that Pedroia was safe before changing his mind, and the on-field call was confirmed as the second out of the inning after replay review.
"I pretty much knew I had to go out there and give, whether it was going to be three, four or five innings and just put up zeros," said Brach, who has wins in four of his last seven appearances. "I wasn't worried about who was going to be able to pitch just more put up zeros and give us a chance to win."
But with the O's 'pen dangerously thin, Showalter wanted to stay away from Darren O'Day and had just closer Zach Britton available. Brach saved Baltimore from having to call on emergency pitcher Chris Davis for another performance at Fenway.
"I said 'You're next,'" Showalter said of Davis, who famously recorded the win over Boston after two scoreless innings May 6, 2012. "He was ready."
Brach, who was followed by Britton, helped stabilize things after the O's bullpen uncharacteristically fell apart. Tasked to protect a five-run lead, the relief corps -- a game removed from a fantastic 5 1/3 scoreless innings performance -- couldn't keep the Red Sox down as Baltimore used a season-high four relievers in a long, and unfortunate, bottom of the seventh.
Lefty T.J. McFarland, who allowed a run charged to starter Kevin Gausman in the sixth, surrendered a one-out homer to David Ross and exited after Jackie Bradley Jr.'s single. Ryan Webb, who was charged with three runs, allowed three straight singles to give Boston five consecutive hits and cut the deficit to 6-4. Webb struck out Pedroia and exited in favor of lefty Brian Matusz, who entered the game a career 1-for-22 against slugger David Ortiz.
But Ortiz bucked the trend, sending a ball into right field to score another run and force Showalter to bring on another reliever, righty Tommy Hunter. Hunter gave up the lead, on Mike Napoli's line-drive single to left field, before Hunter struck out Stephen Drew to end the inning.
The relief corps' struggles erased a four-run seventh from the Orioles, who had scored two runs off Red Sox starter Jake Peavy in his six innings. The Orioles scored three runs off reliever Burke Badenhop, who started the seventh in relief of Peavy.
"Anytime you get a W, you're up by five runs and they come back tie it up and you find a way to score that run and get it done. … I think today was a huge one," said Orioles All-Star outfielder Nelson Cruz, who went 3-for-6 with an RBI and two runs scored.
It was also a long one, with the five-hour contest starting with a solid outing from Gausman. Recalled from the Minor Leagues before the game, Gausman pitched well but ran up a high pitch count that forced his exit after 5 1/3 innings. The righty, who held Boston to a run on four hits and a pair of walks, tallied a career-high seven strikeouts and has allowed one run or fewer in four of his past five big league starts.
"I threw a lot of fastballs today," Gausman said. "Really challenged them and my last outing, I think I kind of shot myself in the foot, kind of just throwing too much offspeed there. Today, that was really my main focus was to just go in there and try to pound the strike zone in and out with my fastball."
Gausman has been on an odd schedule, making his last start for short-season Aberdeen, and shuffling back and forth from the Minors despite mostly pitching well. Showalter reminded reporters that there's a method to the O's madness.
"Guys that have really good stuff are not going to throw 80 pitches in seven innings. Because pitchers make a living on pitches that appear as something you want to swing at," Showalter said. "He's going to have deep counts. So you'd love to see him have a little lower pitch count, but I think every time he goes out, it's good for him. We are managing his innings so at some point, he's good enough and we are good enough to pitch the rest of the season."
Brittany Ghiroli is a reporter for MLB.com. Read her blog, Britt's Bird Watch, and follow her on Twitter @britt_ghiroli. This story was not subject to the approval of Major League Baseball or its clubs.