Jorge Mateo, Adley Rutschman, Ryan Mountcastle and Ramon Urias also connected for the Orioles, who had combined to score three runs in their previous two games, both losses.
This time, the Orioles scored three runs in the second inning, three more in the third, four in the fourth and five in the fifth - after the Red Sox put up a five-spot in their half of the fifth to get within 10-9. Baltimore's 15 runs were a season high, and the teams combined for 37 hits, with the Red Sox outhitting the Orioles 19-18.
''I was uneasy until two outs in the ninth inning,'' Orioles manager Brandon Hyde said. ''A game like this, it was obviously a weird night. You're kind of expecting after a while for some things to happen that wasn't going to go your way. You didn't know what was going to happen. Fortunately for us, we pitched well the last three innings.''
None of Boston's hits left the ballpark, while all but one of Baltimore's homers came with at least one man on base. Mateo got the Orioles rolling with a two-out, three-run shot to left in the second off Kutter Crawford (3-5) that made it 3-2.
''There were some wild moments,'' Mateo said through a translator. ''I was just super happy for me and my teammates the way we were able to go out there and compete and just win the game in the end.''
Baltimore moved within 1 1/2 games of Tampa Bay for the final AL wild card spot.
Nick Vespi (5-0), the third of six Orioles pitchers, got the win, allowing one run in one inning.
Santander's two-run shot to right in the third was his career-high 21st homer. He finished 3-for-5, adding a two-run double in the fifth.
Crawford allowed nine runs and 11 hits - both career highs - over 3 2/3 innings.
Boston scored five times in the fifth against reliever Keegan Akin on an RBI single by Eric Hosmer, a three-run double by Tommy Pham and another single by Alex Verdugo. All the runs were unearned because of errors by second baseman Rougned Odor and catcher Rutschman.
The Orioles rebuilt their lead in the bottom half against Ryan Brasier. Urias homered to straightaway center. Mountcastle and Austin Hays followed Santander's double with RBI two-baggers of their own.
''They didn't stop,'' Red Sox manager Alex Cora said. ''They were relentless. They hit everything - fastballs, breaking balls, cutters. We called it, they hit it. They are a really good club.''
??Red Sox shortstop Xander Bogaerts was ejected in the fourth inning after throwing his bat and arguing a called third strike. Cora was thrown out moments later during an animated argument with home plate umpire Todd Tichenor.
''I need to be quicker. I don't want him to get thrown out,'' Cora said.
Red Sox: ??RHP Josh Winckowski was optioned to Triple-A Worcester.
Orioles: OF Kyle Stowers' contract was selected from Triple-A Norfolk. He started in right field, batted fifth and went 2 for 5. ... INF Richie Martin and LHP Vespi were also recalled from Norfolk. ... RHP Logan Gillaspie was optioned to Norfolk. ... INF Terrin Vavra was placed on paternity leave. ... OF Brett Phillips was designated for assignment.
Red Sox: LHP Matt Strahm (left wrist contusion) was activated from the 15-day injured list. ... LHP James Paxton has a lat strain and will undergo an MRI on Saturday. ... Pham left the game in the fifth with low back tightness.
Red Sox: RHP Michael Wacha (7-1, 2.44 ERA) was reinstated from the IL on Sunday and threw seven scoreless innings with a season-high nine strikeouts against the Yankees that night.
Orioles: RHP Kyle Bradish (1-4, 6.38) has allowed nine runs over 7 2/3 innings with two walks and four strikeouts in his two starts against Boston.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.