Torres, given the day off from the starting lineup, is hitting .320 (8 for 25) with seven RBI since returning from the injured list. He feasts on the Orioles, raising his average against them to .358 with 16 homers and 34 RBI in 37 games.
His drive off left-hander Tanner Scott went to the warning track in right-center and followed two-out singles by Aaron Hicks and Clint Frazier off Dillon Tate (1-1). Frazier, who hit cleanup for the 16th straight game, reached on a grounder to the right side when Tate, covering first, missed the first base.
"Once they brought Scott into that spot, I felt like it was his spot and he goes up there put a great at-bat and obviously wins us the game," Yankees manager Aaron Boone said.
Torres batted for lefty-swinging Brett Gardner, who is 1 for 13 against left-handers this season and kept up hitting well while wearing glasses. He brought them back after wearing them at times last season and drove in four runs Wednesday and is 7 for 14 in his last five games while wearing the glasses.
"I think first of all I feel really good with the glasses," Torres said.
Torres wore them at times last season when he hit 38 homers and said they are not prescription glasses
"Even before these last several games, it has seemed like he's done really well with them," Boone said. "The first day he had them on again in Buffalo, guys on the bench were yelling leave those on', I guess I hope he leaves them on."
New York (26-21) has won five in a row following a 5-16 slide and has opened a 5 1/2-game lead over the Orioles for the AL's eighth and final playoff spot.
Baltimore (20-26), which took three of four from the Yankees last weekend at Camden Yards, has lost five straight overall and 10 in a row at Yankee Stadium.
"We just had a tough time scoring runs this whole series," Orioles manager Brandon Hyde said. "They pitched very well and we just had a tough time stringing hits together. One run against today and you're not going to win against the Yankees scoring one run."
The young Orioles had gotten back in contention with six wins in eight games.
New York is a half-game behind the second-place Toronto Blue Jays, who start a series at Yankee Stadium on Tuesday.
Five relievers combined for shutout, one-hit relief following J.A. Happ. Zack Britton (1-2), the fourth Yankees reliever, pitched a 1-2-3 eighth and Aroldis Chapman struck out two in a perfect ninth for his second save.
Happ allowed five hits in five innings, giving up a second-inning home run to Renato Nunez, who has five off the left-hander. Happ lowered his ERA to 3.96 and has a 2.45 ERA in his last five starts followin a 10.29 in his first two.
"I felt like he made a lot of big pitches today in different spots," Boone said.
Tyler Wade homered in the third off John Means, who allowed five hits in six innings to match his longest outing this season.
Both home runs went over the right field short porch and would not have cleared the wall at any other big league ballpark.
Jonathan Holder stranded two in the sixth after Adam Ottavino walked Pedro Severino and allowed a single to Nunez. It was Ottavino's first appearance since giving up six runs Monday to Toronto in Buffalo.
Chapman's appeal of his three-game suspension for throwing a 101 mph fastball near the head of Tampa Bay's Michael Brosseau on Sept. 1 is scheduled to be heard on Monday, according to Boone.
Orioles: OF Austin Hays (fractured rib) could return in the next few days according to manager Brandon Hyde. Hays has not played since Aug. 14.
Yankees: RF Aaron Judge (strained right calf) took swings in the batting cage, ran the bases, ran in the outfield and did defensive drills. Judge, who has played once since Aug. 11, will go the alternate site in Scranton-Wilkes/Barre on Monday and could be activated next weekend. ... DH Giancarlo Stanton (strained left hamstring) ran the bases, took a few at-bats at the alternate site and is expected to take more at-bats Monday. ... 3B Gio Urshela (bone spur in right elbow) played in a simulated game at the alternate site and is expected to be activated for Tuesday's game against Toronto. ... RHP Jonathan Loaisiga (undisclosed medical condition) threw a bullpen Sunday and will likely return Tuesday. ... After the game, RHP Clarkes Schmidt was optioned to the alternate site.
Orioles: RHP Jorge Lopez (1-0, 6.38) opposes RHP Touki Toussaint (0-1, 7.89) in the opener of a three-game series with Atlanta on Monday in Baltimore.
Yankees: RHP Deivi Garcia (1-1, 3.06 ERA) opposes RHP Taijuan Walker (3-2, 2.95) in the opener of a three-game series against Toronto Tuesday at home.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Yankees top Orioles for 4th straight win
Gleyber Torres' pinch-hit, two-run double in the eighth inning gives the Yankees a 3-1 win over the Orioles.