CLEVELAND — Corey Kluber upstaged Sonny Gray’s debut for New York by pitching a three-hitter and leading the Cleveland Indians to a 5-1 win over the sloppy Yankees on Thursday night.

Kluber (9-3) struck out 11 and Cleveland’s ace threw his third complete game this season as the defending AL champions won the opener of a four-game series with a potential playoff opponent, ending their losing streak at three.

For five innings, Gray (6-6) was nearly as good as Kluber, but New York made three errors in the first behind the right-hander, who was acquired at Monday’s trade deadline from Oakland to help the Yankees return to the postseason.

Gray allowed only two hits until the sixth, when Yan Gomes broke an 0-for-13 slide by hitting a two-out, two-run double to put Cleveland up 4-0.

With his latest dominant performance, Kluber joined Hall of Famers Randy Johnson, Pedro Martinez and Nolan Ryan as the only pitchers to strike out at least eight in 12 consecutive starts.

Johnson did it four times in his career and holds the record with 17 straight.

Kluber was locked in from the start and carried a two-hit shutout into the seventh before Gary Sanchez belted his 17th homer, a 427-foot laser shot to center.

Along with containing the Bronx Bombers, Kluber didn’t force Indians Manager Terry Francona to go deep into a bullpen missing All-Star reliever Andrew Miller, who is on the disabled list with knee tendinitis.

The Yankees sat struggling slugger Aaron Judge for the series opener. The major league home run leader is batting just .164 (11 of 67) with 29 strikeouts since the All-Star break.

Gray certainly didn’t get any help from his defense in the first, when the Yankees kicked the ball around like Little Leaguers.

First baseman Chase Headley and second baseman Tyler Wade both booted grounders, and after Jose Ramirez hit a one-out RBI single, right fielder Clint Frazier – the former Indians prospect traded away for Miller last season – airmailed a throw to third into the photographer’s pit, allowing Michael Brantley to score.

NATIONAL LEAGUE

DIAMONDBACKS 10, CUBS 8: Paul Goldschmidt snapped a tie in the ninth inning with his third long homer of the game, and Arizona pulled out a rain-delayed victory at Chicago.

BREWERS 2, CARDINALS 1: Keon Broxton drove in the go-ahead run and saved a run with a leaping catch, Matt Garza made a strong start in his return from the disabled list, and Milwaukee won at home.

ROCKIES 5, METS 4: Nolan Arenado walked with the bases loaded in the bottom of the ninth inning for host Colorado.

Charlie Blackmon and Mark Reynolds homered for the Rockies, who maintained a 51/2 game lead over Milwaukee for the NL’s second wild card slot.

PIRATES 6, REDS 0: Chad Kuhl allowed four hits in seven efficient innings, Starling Marte went 3 for 4 and scored three times and host Pittsburgh had little trouble with Cincinnati.