Updated

Boston, MA (SportsNetwork.com) - Dustin Pedroia scored the game-winning run on a throwing error in the ninth inning to complete Boston's comeback and give the Red Sox a 6-5 win over the Baltimore Orioles on the eve of Patriots' Day.

Sunday night's game began with an emotional ceremony dedicated to those impacted by last year's Boston Marathon tragedy and ended with the hosts giving the Fenway Park faithful something to cheer about.

The Red Sox scored six unanswered runs to win for the fourth time in five games, the deciding run coming on David Lough's errant throw from left field.

Pedroia was on third with the bases loaded and one out, and Mike Carp, pinch- hitting for Jonny Gomes, sent a sharp line drive to left field. Lough caught the ball on the run, but his throw home was not cut off by third baseman Jonathan Schoop and caromed wildly off the backstop. Pedroia hesitated trying to score at first but wound up scoring without a throw.

"All their outfielders have great arms, so you have to get a great jump for situations like that. We just lucked out," Pedroia said.

Jonny Gomes hit a three-run homer off Ubaldo Jimenez in the sixth inning to get the rally started, then David Ortiz and Mike Napoli each knocked in a run in the seventh.

Adam Jones went 4-for-5 with a run scored and an RBI to highlight Baltimore's offense, but it wasn't enough as the Orioles dropped their second straight game on the heels of a three-game winning streak.

Jimenez was staked to a 5-0 lead before the momentum changed in the sixth when Gomes, with runners on first and second, sent a hanging breaking ball into the bleachers above the Green Monster for a three-run homer.

Boston pulled even in the seventh against Zach Britton, thanks in part to Ryan Flaherty botching a potential inning-ending double play ball. Flaherty took the throw to second and dropped the ball on the transfer, and second base umpire Paul Schrieber ruled he never made the catch cleanly.

"I dropped the ball. Didn't turn the double play like I should have," Flaherty said. "That's the way the rule is. I didn't turn the double play like I should have."

Pedroia followed with a single to load the bases, and Ortiz brought in a run with a base hit to right, cutting Boston's deficit to 5-4.

Evan Meek relieved Britton and got Napoli to ground one to third, but Matt Wieters couldn't secure Schoop's one-hopper to the plate, allowing Grady Sizemore to score the tying run.

In the ninth, Pedroia was a foot away from a walk-off home run against Brian Matusz (1-1) but settled for a double when a fan reached over the wall and touched the ball. Ortiz was intentionally walked and Napoli took a fastball off his left knee prior to the wild finish.

Edward Mujica (1-1) stranded a runner on third in the ninth to earn the win behind Jake Peavy, who labored through a three-run first inning. His first mistake was sent over the Monster for a solo homer by Nelson Cruz, and the next three batters all reached base, with Wieters singling in Chris Davis and Jones racing home on J.J. Hardy's sacrifice fly to center.

Lough's RBI double in the fifth made it a 4-0 game, and Peavy was chased an inning later following Jones' two-out, run-scoring single.

Peavy was charged with five runs on 10 hits and four walks and took a no- decision for a fourth straight start to open the season.

Game Notes

Jimenez yielded three runs on four hits and three walks over 5 1/3 innings ... Cruz's homer in the first ended a string of four straight games without a homer for the Orioles, their longest stretch since June 2012 ... Davis has reached base safely in 16 straight games ... The series finale will be decided early Monday, with the first pitch on Patriots' Day scheduled for 11:05 a.m. (ET).