The game turned when Orioles manager Buck Showalter stuck with left-hander Wade Miley, who had thrown 99 pitches, in the seventh. Miley then allowed a leadoff game-tying home run to rookie Tyler Austin.
Showalter was hoping he could get Miley through the seventh, past the bottom two hitters in the Yankees lineup, and avoid left-handed hitters like Brian McCann, Jacoby Ellsbury and Didi Gregorius coming off the bench to pinch hit so early in the game.
"You're just picking your poison," Showalter said.
Instead, Miley would never get to the top of the order, chased from the game after allowing the homer to Austin and a single to Ronald Torreyes.
The Orioles bullpen, which entered the game having not allowed an earned run in 10 2/3 innings four games into this final road trip of the season, picked a bad day to have a hiccup, allowing four runs in the eighth inning, all of them charged to right-hander Brad Brach (10-4).
"It seemed like we were in control there for six innings and then all of a sudden you look at the scoreboard, and it's tied," Brach said, "and I just went out there and got out of hand quick and didn't turn around quick enough."
The Orioles' run to the playoffs has been boosted by their resurgence on the road, and they were on their way to securing their fifth straight road series win to put them on the cusp of a postseason berth when they took an early 3-0 lead.
Miley allowed just two hits over four scoreless innings to start his outing, but the Yankees scored single runs in the fifth and sixth innings before Austin's homer to open the seventh tied the game at 3.
Miley entered the seventh inning at 99 pitches, but had allowed runs in his previous two innings, and each time had to strand two base runners to avoid further damage.
"I thought he pitched real well," Showalter said of Miley. "May have gotten the ball up a little bit more than he had, but he was I thought really good again, especially with six days off. He was strong, rested. I think when he got some of the strongness out of him after the first inning, he was throwing a lot better after the first inning. He had a lot of quick innings and was throwing the ball real well."
An Orioles offense that has struggled to find consistency in the second half of the season jumped on Yankees right-hander Luis Severino early.
Right fielder Michael Bourn continued to contribute since being acquired in an Aug. 31 trade with the Arizona Diamondbacks. Bourn hit a two-run single into the right-center-field gap with two outs in the second inning to give the Orioles a 2-0 lead.
Orioles third baseman Manny Machado added a solo homer with two outs in the third inning, taking an 0-2, 98 mph fastball the opposite way over the right-field fence.
Before giving up the game-tying homer to Austin in the seventh, Miley showed signs of wearing down but avoided a big inning.
Austin put the Yankees on the board with a one-out RBI single in the fifth, but Miley escaped further damage by striking out Torreyes and inducing an inning-ending groundout from Brett Gardner.
Chase Headley's RBI double capped a two-out rally in the sixth, but Miley stranded two runners in scoring position by striking out Austin Romine to end the inning.
Austin's game-tying homer came after Miley got ahead 1-2. Austin proceeded to hit a slider that crept over the heart of the plate into the Yankees bullpen in right-center field.
"He got two balls up over the plate," Wieters said of Miley. "He'd been locating in well all day and his slider had been good. And one ball to Austin, slider kind of backed up on him a little bit and same thing with the fastball to Torreyes. He had thrown the ball well. Maybe a little bit of fatigue. He got the ball back over the middle of the plate and they took two good swings on them."
The Orioles dodged further damage in the seventh when Starlin Castro's chopper up the middle off Mychal Givens found shortstop J.J. Hardy, who started an inning-ending 6-3 double play.
Romine ended up being the hero, hitting a looping two-run single to left off Brach to score two runs after Brach walked Jacoby Ellsbury and allowed a double down the right-field line to Headley. Gardner then hit a two-run double off Oliver Drake, scoring two inherited runners that were charged to Brach, to put the Yankees up 7-3.
With a win Saturday, the Orioles could have sealed a playoff spot with losses by either the Blue Jays or Tigers. Following their loss, they couldn't clinch a postseason berth Saturday regardless.
"It would have been nice to watch [the night games] with the win today," Wieters said. "But at the same time, still watch them and I'll pull for the Braves and Ill pull for the A's and I'll pull for the Red Sox tonight."