HRs = Ws. Joe Girardi knows the home run-produces-wins equation well.

"We get a couple of guys on and you know, it's been kind of our formula," he said Sunday after Brian McCann's three-run homer and Alex Rodriguez's blast on consecutive pitches in the sixth inning allowed the Yankees to overcome a three-run deficit in a 6-4 win over the Rays.

The Yankees are 41-11 when they hit at least two homers. The victory kept them 11/2 games behind the AL East-leading Blue Jays, who beat the Orioles and are 28-7 since falling eight games behind the Yankees on July 28.

The Yankees do not have to scoreboard-watch. "No, I mean we don't even have to look. We know what's going to happen up there," Rodriguez said, referring to Toronto's almost daily victory.

This game seemed like a lost cause when the Rays built a 3-0 lead against Ivan Nova on a two-out, two-run homer by Kevin Kiermaier in the second and a two-out RBI single by Logan Forsythe in the third. That's because the Yankees were facing Chris Archer, who had a 5-0 record and 1.78 ERA in eight previous starts against the Yankees.

Rodriguez said, "I mean, we were sleepwalking there for five innings and Archer was basically dominating us."

advertisement | advertise on newsday

The Yankees were 1-for-17 in the game and 10-for-77 in the series when with one out in the sixth, Jacoby Ellsbury singled for his second hit. After Brett Gardner struck out and Carlos Beltran walked, Archer fell behind McCann 3-and-0 and threw a strike.

Two pitches later, the Yankees had the lead. McCann unloaded a long three-run homer, leaving Archer with both hands on his head in anguish as the ball headed toward rightfield. It was McCann's career-high 25th.

"It was big. He was in a groove," McCann said, pointing out that Archer hadn't had to pitch from the stretch much until the sixth. "We were able to get some balls out over the plate and didn't miss them . . . I was able to get into a favorable count and put a good swing on a pitch."

On the next pitch, Rodriguez hit his 28th homer, a blast to right-center that put the Yankees ahead for good at 4-3.

"That was not as big as Mac's," Rodriguez said, continuing his 2015 mode of being humble. "But it was good." He believes his swing has returned after a poor August, saying, "We're down the stretch now, full sprint."

Yankees videos

Didi Gregorius scored the fifth run in the seventh when Forsythe, with no chance of turning a double play on Gardner's bouncer up the middle, got the force at second but bounced his relay throw past first baseman James Loney.

Dellin Betances, who pitched 11/3 innings, yielded a home run by Asdrubal Cabrera in the eighth, but Gregorius' bases-loaded single in the bottom of the inning made it 6-4.

Andrew Miller got the first two outs of the ninth before surrendering singles by Mikie Mahtook and Evan Longoria. Miller then struck out Brandon Guyer for his 31st save in 32 opportunities.

McCann understood the importance of his homer, saying, "Sometimes you hit a home run in a 10-1 game [and] it means nothing."

He hit .232 with 23 homers and 75 RBIs last season, his first in pinstripes. He is at .245 with 86 RBIs this season and is arguably the team's MVP on offense.

advertisement | advertise on newsday

Of his 48 homers since joining the Yankees, he has hit 35 at Yankee Stadium. "It's a great hitter's yard for lefthanded hitters," he said. "For me, I absolutely love it."