NEW YORK — Now this was the dominant Masahiro Tanaka that the New York Yankees wanted to see.

Looking every bit like an ace, Tanaka took a perfect game into the sixth inning and struck out a career-high 14 as the Yankees beat the Tampa Bay Rays 6-1 Friday night for their fifth straight win.

Boosted by three home runs, Tanaka and the Yankees had even more to show for their effort — they moved back into first place in the AL East for the first time in a month, edging ahead of the Boston Red Sox.

“Just to see him dealing like that is encouraging,” manager Joe Girardi said. “You want to get him on a roll.”

Tanaka (8-9) struck out the first five batters, all on swings, and also fanned the side in the eighth to end his outing.

The Japanese star was winless in his past three starts, and has been plagued by inconsistency most of the year. That came after he went a combined 39-16 in his first three seasons in the majors.

“I don’t think it’s the right time to be comparing and looking back,” Tanaka said through a translator. “My focus is on this year.”

Brett Gardner hit a leadoff home run, Aaron Judge lined his AL-leading 33rd homer and Clint Frazier added a three-run shot. All three drives came from the starting outfielders.

On Thursday night, Gardner won the opener of this four-game set between playoff contenders with a homer in the 11th. Judge wound up losing half of his front left tooth in the celebration — he got a temporary fix earlier in the day.

Tanaka set down 17 in a row before Adeiny Hechavarria grounded a sharp, two-out single up the middle, past diving shortstop Didi Gregorius. Tanaka impassively watched the ball roll into center field and, after a brief ovation from the fans, went back to work.

“Right out of the gate, he went his split, his cutter, his slider. Kept of us off-balance, racked up a ton of strikeouts,” Rays manager Kevin Cash said. “From the side there didn’t appear to be many pitches that guys could handle.”

Tanaka allowed two hits and walked none. He doffed his hat to the crowd as he walked off the mound, then tipped his cap once more before reaching the dugout.

“Hopefully, I was able to entertain everybody,” he said.

David Robertson closed with a perfect ninth to wrap up the game in 2 hours, 23 minutes.

Lucas Duda homered in the seventh, a day after Tampa Bay got him a trade with the New York Mets. A veteran of Subway Series matchups at Yankee Stadium in the past, he got booed rounding the bases. It was his 18th homer overall this year.

Austin Pruitt (5-2), called up from Triple-A to take the turn of injured Jake Odorizzi, gave up all three homers in five innings. The Rays have lost seven of nine and are 0-5 in the Bronx this year.

Gardner gave the Yankees a fast start with his career-high 19th homer, and fourth leadoff drive of the season. He leaped to bump forearms with Judge on his way back to the dugout.

The previous night, Gardner tossed his helmet as he approached the plate after his walkoff homer. Judge picked up the helmet — he didn’t want anyone to accidentally step on it. In the jumping and jostling, the helmet got jammed into Judge’s mouth and cracked his tooth.

Judge homered in the fourth and Frazier made it 5-0 in the fifth.

ROSTER MOVES

Rays LHP Adam Kolarek hit Gardner in the shoulder with a pitch to begin the eighth, and later gave up Gregorius’ RBI single. Kolarek was sent to Triple-A Durham after the game to make room for righty reliever Steve Cishek, acquired earlier in the day from Seattle.

NUMBERS GAME

Tanaka topped the 13 strikeouts he had on May 26 vs. Oakland. … Judge has a 17-game home hitting streak, breaking the Yankees rookie record set by Hideki Matsui in 2003, the Elias Sports Bureau said. … Tampa Bay pitchers have given up a homer in 15 straight games, their worst run since 2006.

TRAINER’S ROOM

Rays: 1B Logan Morrison was out of the lineup because of a bruised left heel.

Yankees: Closer Aroldis Chapman threw 19 pitches in two innings Thursday night, his longest outing since Game 5 of the World Series for the Cubs last year. Manager Joe Girardi wasn’t sure whether Chapman would be available.

UP NEXT

Rays: LHP Blake Snell (0-6, 4.86 ERA) beat the Yankees twice last year as a rookie. He’s the first Rays pitcher to lose his first six decisions in a season since Edwin Jackson opened 0-8 in 2007.

Yankees: Rookie LHP Caleb Smith (0-1, 8.10) struggled for 3 2/3 innings last weekend in his first major league start, losing at Seattle. He turned 26 on Friday.


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