BALTIMORE (AP) — Held hitless by Aaron Cook through five innings, the Baltimore Orioles sent 10 batters to the plate during a five-run sixth and beat the Boston Red Sox 5-3 Wednesday night.

Baltimore trailed 2-0 before rallying against Cook, who fueled the uprising with a throwing error on a potential inning-ending, double-play comebacker. The miscue led to three unearned runs and saddled Cook (3-6) with his fourth loss in five starts.

Rookie Miguel Gonzalez (5-2) allowed two runs and six hits in six innings to help the Orioles (64-53) secure their ninth win in 11 games and move a game ahead of Tampa Bay for the top AL wild-card spot.

Jim Johnson worked the ninth for his 35th save in 38 tries. The game ended with rookie third baseman Manny Machado making a diving stab of Nick Punto’s liner down the line.

Carl Crawford had two RBIs for the Red Sox, who have lost six of eight to fall four games under .500 (57-61) for the first time since May 13. Cleanup hitter Adrian Gonzalez and manager Bobby Valentine were both ejected in the eighth inning for arguing with home plate umpire Mike Everitt.

Cook was unhittable through five innings, allowing only a pair of walks and getting 13 of 15 outs on grounders. He got the first out in the sixth on a groundball, and then the trouble began.

Nick Markakis walked and J.J. Hardy lined a single to left. Nate McLouth hit an RBI single, and with runners on the corners Adam Jones hit a bouncer to Cook, who threw wildly to second. Hardy scored the tying run, and Matt Wieters put the Orioles in front and chased Cook with an opposite-field, ground-rule double to left.

Andrew Miller got Chris Davis to hit a grounder to drawn-in second baseman Dustin Pedroia, who threw home. Jones lowered his left shoulder and ran hard into catcher Jarrod Saltalamacchia, who applied the tag for the second out. But Mark Reynolds followed with a two-run double off Junichi Tazawa for a 5-2 lead.

Crawford got Boston to 5-3 in the seventh with a run-scoring groundout, but Boston went down in order in the eighth and ninth.

The Red Sox are 3-8 against Baltimore this season and have lost five of the last six series between the teams dating to last season.

Limited to two singles and a walk through four innings, Boston grabbed a 2-0 lead in the fifth. After Scott Podsednik and Punto singled, Jacoby Ellsbury doubled in a run and Crawford followed with a sacrifice fly.

NOTES: Omar Quintanilla made the first and last outs in the Baltimore sixth. … Boston DH David Ortiz was told to stop running for a few days as he attempts to return from a right Achilles strain. He’s been on the DL since July 18. … Orioles INF Wilson Betemit will have an MRI performed on his sore right wrist “to see if there’s anything more than tendinitis,” manager Buck Showalter said. … Boston RHP Clay Buchholz pitches in the series finale against Baltimore’s Chris Tillman. All three of Buchholz’s career shutouts have come against Baltimore. … Orioles DH Jim Thome, who’s on the DL with a herniated disk, served as an assistant scout Tuesday night while pitching prospect Dylan Bundy threw for Double-A Bowie. … Ellsbury has a 38-game hitting streak against Baltimore dating back to April 17, 2009.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.