Anthony Rizzo #48 of the Yankees celebrates his eighth inning two-run...

Anthony Rizzo #48 of the Yankees celebrates his eighth inning two-run home run against the Tampa Bay Rays with teammate Gleyber Torres #25 at Yankee Stadium on Friday, May 12, 2023. Credit: Jim McIsaac

It was a marketing person — and Yankees fan’s — dream come true.

Anthony Rizzo hit two home runs on Friday night on the same night that a “Star Wars”-themed Anthony Rizzo bobblehead was given out at Yankee Stadium.

The second home run was a dramatic and majestic go-ahead two-run shot to right in the bottom of the eighth that powered the Yankees to a 6-5 victory over the Rays before a sellout crowd of 46,130 at Yankee Stadium.

Asked if he is a “Star Wars” fan, Rizzo said: “I am now.”

The bobblehead showed Rizzo in a costume from “The Mandalorian,” a TV offshoot of the “Star Wars” movie franchise.

The Yankees had fallen behind 5-4 in the top of the eighth on Josh Lowe’s opposite-field three-run home run off Michael King.

That seemingly crushing moment for the home team came after the Yankees had snapped a 2-2 tie with a two-run seventh.

But Rizzo showed the force was still with the Yankees when he hit the first pitch thrown by reliever Jason Adam 398 feet to rightfield to give the Yankees the lead for good. Rizzo’s eighth home run drove in Aaron Judge, who had walked with one out.

“[Rizzo] was at his best,” said Gerrit Cole, who allowed two solo home runs in five innings. “And we needed it.”

Rizzo admired his blast at home plate before he started his trot. The ball had a launch angle of 40 degrees, which is a fancy way of saying it was hit very high.

“I hit it really well — it was high,” Rizzo said. “But I thought I got enough of it, for sure.”

The Yankees (22-18) moved to within eight games of AL East-leading Tampa Bay (30-10). The Rays have beaten the Yankees in three of five meetings. If the Yankees can get closer in the standings, the division chase could be, as Rizzo called it, “a dogfight every night.”

“It was electric tonight,” Rizzo said after the first Yankee Stadium sellout since Opening Day. “I thought there was extra juice from the fans.”

With the score tied at 2 in the seventh, the Yankees took the lead on an RBI single by Anthony Volpe, who had hit a solo homer to right-center in the fifth after getting dropped to seventh in the order.

Oswaldo Cabrera had another RBI single two batters later to make it 4-2, but the inning ended when Cabrera was thrown out trying to take second on the play.

King already had pitched a scoreless inning when he took the mound for the eighth. But Harold Ramirez and Paredes singled and Lowe smashed a three-run homer to leftfield to give Tampa Bay a 5-4 lead.

Cole’s outing was shorter than his usual standard because he needed 55 pitches to get through the first two innings.

Randy Arozarena gave Tampa Bay a 1-0 lead three batters into the game with a 422-foot homer into the second deck in left. Rizzo tied the score in the bottom of the first with a home run to right off opener Trevor Kelley.

Jose Siri hit a two-out homer off Cole in the second to give the Rays a 2-1 lead.

Cole gave up an American League-high 33 home runs in 2022. After going 51 innings without giving one up in 2023, he has allowed four home runs in parts of four innings to Tampa Bay over two games, including last Sunday.

But the Yankees’ ace settled in, needing only 40 pitches to get through his final three innings. Overall, Cole allowed five hits, walked two and struck out four.

“I think that embodied overall our night,” Aaron Boone said. “Like, a gutsy effort. It wasn’t perfect, right?”

More Yankees headlines

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME