TORONTO — Blue Jays slugger Marcus Semien set a major-league record for home runs by a second baseman when he hit his 44th of the season Wednesday against Yankees ace Gerrit Cole, in a critical 6-5 victory.

Semien’s homer, a two-run drive into the left field bullpen, broke a tie with Davey Johnson (1973 for Atlanta), and gave Toronto an early lead in their September showdown against an AL wild-card rival.

Rogers Hornsby (42 home runs in 1922) and Brian Dozier (42 in 2016) are the only other second basemen in big-league history to top the 40-homer mark.

Semien’s homer was Toronto’s ML-leading 249th of the season. They ended the night with 251. But from a team standpoint, what was more important was a victory that snapped New York’s seven-game winning streak, and kept Toronto hanging around the pecking order in the hunt for the two American League wild-card spots during this final week of the season.

The loss trimmed New York’s lead on the top spot to just one game over the second-place Boston Red Sox, who defeated the Baltimore Orioles. Meanwhile, Toronto stayed just one game behind Boston for the No. 2 position, with the Seattle Mariners, also in the hunt, still to play later Wednesday night.

Four of Semien’s home runs this season have come while he was playing shortstop. But the nine-year veteran, an All-Star for the first time this season, has made 142 of his 157 starts at second base.

The homer was the only hit of the night for Semien, but the Blue Jays, as a collective, were able to get to Cole before ultimately hanging on for the win. Cole allowed five earned runs on nine hits in six innings, while striking out six.

“He obviously settled down after the first two hitters, but Semien got him for that home run, and that ball just settled into the barrel,” Yankees manager Aaron Boone said of Cole. “It was a good job by (the Blue Jays). Good job by them being aggressive.”

Neither Cole nor Toronto starter, Jose Berrios figured in the decision. But Berrios did something most starters haven’t been able to do the last two weeks, and that’s slow the Yankees. He allowed three earned runs on four hits in six innings of work, while striking out seven.

Semien’s teammate, Bo Bichette, hit two home runs in the win, including the game-winner, a solo shot in the eighth inning.

“This is what we dream of doing,” Bichette said. “I wouldn’t be playing baseball if it wasn’t for moments like this.”

Semien signed a one-year, $18 million contract with Toronto this season. He finished third in AL MVP voting in 2019 with Oakland, when he hit 33 homers with 92 RBIs with an .892 OPS, and is in line to be one of the most marketable free agents this offseason.

The 31-year-old Semien had played most of his career at shortstop before leaving the A’s to join the Blue Jays. The home run was his 12th this month, good for most in the majors. According to ESPN Stats & Information research, he is the first player in Blue Jays history to hit 12 in a single September.

Toronto now has four players with 100 RBIs, and it’s the first time that each has made it that far in a season: Teoscar Hernandez, Vladimir Guerrero Jr., Semien and Bichette.

“It’s a special group on both sides of the ball,” Bichette said.

The Associated Press contributed to this report.