NEW YORK (AP) — Alex Cobb had gone two months without a win, and the weight became a burden as his record fell to 2-14, the most losses in the major leagues.

"At a certain point of that stretch, I'm just hoping not to get a loss," he said. "Not even hoping for wins at that point, I'm just hoping not to lose."

Given a five-run lead in the second inning, Cobb breezed and ended skids for himself and the Baltimore Orioles.

Cobb allowed one run and seven hits in six innings in a 7-5 win over the New York Yankees on Wednesday that ended the Orioles' streak of 11 consecutive road losses.

"He's handled it so well," manager Buck Showalter said. "I'm sure there's some sarcastic response to that, but he's a pro and he's pitched better than that. He's going to be a good pitcher for us when all's said and done. He's got a lot of ways to get you out."

Cobb (3-14) had been 0-7 since a June 5 victory at the New York Mets, losing his last five outings. Since he last won, the Orioles traded Manny Machado, Zach Britton, Brad Brach, Jonathan Schoop, Kevin Gausman and Darren O'Day. Even with the win, they are a major league-worst 33-75.

"It's going to take a lot of clawing and fighting for wins right now," he said. "It's going to be some bumps and bruises along the way, and we're going to have to fight for everything we get. But if you understand that and if you embrace it and you kind of go with the journey that we're on, it makes it a little easier."

Cobb committed to the Orioles in March when he signed a $53 million, four-year contract.

"When I was younger, I remember talking to veteran players. They would tell me how fortunate I am to be in the system when we were winning ballgames," he said. "They would say stories of being on losing teams and just how miserable it really is. And I'm getting a little taste of reality on that with seeing all these good players that we have being shipped off, and just the overall where the season's gone and seeing it come to a head these last couple of days with the trade deadline. It's not fun."

Trey Mancini and Renato Nunez each had three hits and two RBIs as the Orioles took a 5-0 lead in the second and a 7-1 lead in the third against Sonny Gray (8-8). Gleyber Torres homered twice and had four RBIs for New York.

Mancini hit a run-scoring single in the second, and Caleb Joseph reached on a bunt single as third baseman Miguel Andujar delayed his throw because Torres didn't sprint from his second base position to cover first. Nunez followed with a two-run double and Tim Beckham had a two-run single .

Torres led off the bottom half with his first home run since July 1 , and Cobb struck out Giancarlo Stanton to end the inning with the bases load.

Mancini homered into Monument Park behind center field in the third, and Breyvic Valera greeted Lynn with a grounder to Didi Gregorius. The shortstop looked to second for a force, saw Torres wasn't there, and then threw too late to first as another run scored as Valera got his first hit and RBI with the Orioles.

Andjuar got a based loaded-single against Mychal Givens in the eighth, but Paul Fry got pinch-hitter Neil Walker to ground into an inning-ending double play. Torres homered against Mike Wright Jr. in the ninth.

Mancini knows that others will be counted on for more run production following the departures of Machado and Schoop.

"Try not to put too much pressure on yourself, but obviously those are two humongous voids that can't be filled immediately," he said.

DEBUT

Cody Carroll, a 25-year-old right-hander obtained from the Yankees last week in the deal that sent reliever Zach Britton to New York, pitched a scoreless, one-hit seventh in his major league debut.

CONSTRUCTION PROJECT

Orioles executive vice president Dan Duquette said of the team's turn toward youth: "It's a lot like building a house. I think if you demolish the house and build it with the foundation from the ground up rather than renovating it one room at a time, I think it helps in terms of the overall progress you can make."

CATCHING UP

INF Jonathan Villar is scheduled to report to the Orioles at Texas on Thursday, two days after he was acquired from Milwaukee.

LEAPING

Easily out at the plate on a relay throw from Torres in the fifth when trying to score from first on Nunez's double, Joseph slowed and jumped, grabbing Austin Romine and falling gently together with the catcher in an effort to avoid a collision.

TRAINER'S ROOM

Orioles: Strength and conditioning coach Joe Hogarty was hit by a foul ball off the bat of Adam Jones. "It doesn't look like anything's broken, but he's got some lacerations and contusions," Showalter said. "It got him in the mouth and the nose." Showalter said he asked head athletic trainer Brian Ebel "are we at the point where now where we can kid or laugh about it?" and Ebel responded "not quite yet."

UP NEXT

Orioles: RHP Andrew Cashner (3-9) is scheduled to start Thursday for the Orioles and RHP Yovani Gallardo (5-1) for the Rangers.

___

More AP baseball: https://apnews.com/tag/MLBbaseball