Shaw was at second base in the 10th when Cole Sulser (1-2) walked Vladimir Guerrero Jr., and both runners advanced on a bunt. Lourdes Gurriel Jr. followed with a sharp grounder to first that Chris Davis stabbed with a dive, then threw home from a sitting position.
The ball took one hop and went through the hands of catcher Pedro Severino an instant before Shaw crossed the plate.
''For me, that was just a great play getting to the ball. He was trying to make a game-saving play,'' Orioles manager Brandon Hyde said. ''It kind of skipped up on Seve when he threw it from his rear end there. I give credit to CD for getting to the ball.''
Anthony Bass (1-0) entered in the ninth and got the final out of the game.
In the last of the 10th, Dwight Smith Jr. got caught in a rundown after sprinting too far past third base on a one-out single by Cedric Mullins.
''Disappointed that we didn't score in the bottom half,'' Hyde said. ''Had an opportunity and made a mistake. Tough loss.''
The Blue Jays had no complaints after improving to 2-3 in extra innings.
''We played well enough to win this game,'' manager Charlie Montoyo noted,
Randal Grichuk extended his torrid hitting surge for Toronto, homering and driving in four runs. He connected with a man on against Wade LeBlanc in the third inning and greeted reliever Travis Lakins with a bases-loaded double to ignite a five-run fifth that made it 7-3.
Grichuk is on a seven-game hitting streak - including four straight multi-hit games - to raise his batting average 75 points to .333. In addition, over the last five games he has four homers and 11 RBIs.
Shaw also homered for the Blue Jays, who can complete a three-game sweep Wednesday.
Anthony Santander hit a pair of two-run homers for the Orioles, giving him nine for the season along with 26 RBIs. But Baltimore dropped its third straight and has lost four of five since a six-game winning streak.
Grichuk's offensive show put Toronto starter Nate Pearson in position to earn his first big league win. But the highly touted prospect was yanked in the fifth after allowing his third homer, a two-run shot by Chance Sisco that got Baltimore to 7-5.
Pearson now has a 6.61 ERA after four starts.
''He's got the stuff to pitch in the big leagues, but he's pitching from behind,'' Montoyo said. ''He hasn't been able to locate all his pitches.''
Toronto pulled off a rare feat Monday night when Grichuk had four RBIs and leadoff man Cavan Biggio added three. According to Elias, it was only the seventh time since 1920 (when the RBI became a stat) that all seven of a team's runs were driven in by the top two batters in the lineup.
Blue Jays: SS Bo Bichette received a second opinion on his ailing right knee, which was confirmed to be a sprain, Montoyo said. There is no timetable for his return. ... 1B Rowdy Tellez was given the day off after getting hit in the head during a collision at first base Monday.
Orioles: SS Jose Iglesias (left quadriceps strain) was placed on the 10-day injured list. He has been playing through the injury for weeks, and Hyde decided it was time to take action. ''We just felt like giving him some extra days would be beneficial to him and us the rest of the season,'' Hyde said. Iglesias is batting .400 but has been serving mostly as the designated hitter, starting only two games at SS in August. ... Reliever Hunter Harvey (right forearm strain) should be back by the end of the month, Hyde said.
Blue Jays: Tanner Roark (1-1, 6.00 ERA) makes his fourth start of year Wednesday afternoon in the series finale. He's 0-3 with a 6.88 ERA lifetime against the Orioles, but hasn't faced them since 2016.
Orioles: Tommy Milone (1-2, 4.00) last pitched against the Jays in 2014 for Oakland.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.