BALTIMORE (AP) Chris Davis singled in the winning run in the 13th inning, and the Baltimore Orioles got home runs from Manny Machado and Steve Pearce in a 6-5 victory over the Boston Red Sox on Tuesday night.

The Orioles have won six of seven to keep alive their narrow shot of earning the second AL wild-card spot.

Gerardo Parra led off the 13th by drawing a walk from rookie Jonathan Aro (0-1). Machado singled, advancing Parra to third, and Robbie Ross came in to face Davis.

Davis lined a 2-1 pitch past the drawn-in infield and into right field to collect his 107th RBI and end the 4-hour, 20-minute marathon.

Chaz Roe (3-2), the seventh Baltimore pitcher, worked the 13th to get the win.

Boston used nine pitchers, limiting the Orioles to one hit from the sixth inning through the 12th.