BOSTON — They won their 99th game imperfectly. This is who the Yankees are — a team good enough to secure home field for the wild-card game and a team defective enough to make you wonder how that game will be in The Bronx.

Aaron Hicks could misplay a ball in center, J.A. Happ can make a laugher go away by yielding a grand slam, Dellin Betances can take his turn at threatening to let the Red Sox back into the game, and both Miguel Andujar and Didi Gregorius can botch double-play possibilities to make life uneasy in the ninth inning, especially since Zach Britton became allergic to the strike zone.

These Yankees can jam plenty wrong into nine innings. Then again, they also cover up ills by hitting homers. Lots of them. In fact, more now than any team in history except the 1997 Mariners.

They hit four more Friday night. That tied those Griffey/A-Rod/Edgar Mariners and assured Wednesday night’s wild-card game against the A’s would be in The Bronx. But it was a reminder they better hit plenty more in October. Can they go over the wall enough to cover for all those ills?

They beat the Red Sox 11-6 Friday, and don’t let the final margin deceive. The Yankees sweated until the end. Boston had the bases loaded in three of the final four innings, and afterward Aaron Boone admitted, “That’s an exhale right there.”

The Yankees can catch their breath now. Assured of the wild-card home field, they can use the rest of the weekend to rest and fine-tune and mull just who will play in that sudden death — namely what pitchers in what order. But having the game in The Bronx matters. Because, in general, home for the Yankees is where the homers are — 24 more than on the road.

“We are built for our ballpark,” Boone said. “Our power plays. Our right-hand hitters use right field to their advantage. We are a good team at home.”

Only the Astros had a better home record this year than the Yankees’ 53-28, but the Yankees used their road might to assure that Game 163 of their season will be in their most comfortable environment. And each of the four homers that got them to 261, 262, 263 and finally record-tying 264 had resonance beyond a Friday night at Fenway.

Gary Sanchez gave the Yankees a 1-0 lead in the third with a 446-foot homer that cleared the Green Monster to Lansdowne Street. His at-bats have been better the past few days, notably in this game in which he also walked, doubled and smoked a 105-mph grounder that shortstop Xander Bogaerts erred on. Let’s face it, the Yankees will pray Sanchez’s passed-ball-heavy defense does not kill them in October and he counters any mistakes with more homers.

Hicks hit a three-run homer that seemingly broke the game open in the fourth, giving the Yankees an 8-0 lead. Both Hicks (hamstring) and Gregorius (wrist) were back in the lineup, another exhale moment for this team that suggests it will be whole for October.

After Steve Pearce’s grand slam moved the Red Sox within 8-4 in the sixth, Luke Voit homered with one out in the seventh. Since Voit hit his first Yankees homer on Aug. 24, he has 13 in all, tied with Milwaukee’s Christian Yelich for the most in the majors in that time frame. Yelich probably will win the NL MVP because of that. Voit won a starting first base job and is the wild card on this Yankees wild-card team.

Aaron Judge led off the eighth with a homer, a high drive that struck to the most center field part of the Green Monster, just outside the yellow line that distinguishes a homer. That tied those 1997 Mariners. It also was — forgive me, the last one — another Yankees exhale because it was Judge’s first homer in 48 plate appearances and 39 at-bats since returning from missing seven weeks due to a fractured wrist.

Boone mentioned that if told before the season the Yankees would tie the homer record in 2018, he would have guessed it was because Judge and Giancarlo Stanton each topped 50, maybe reached 60. Instead, that duo has combined for 64.

“It’s pretty impressive for these guys to pull it off this year,” Boone said. “The fact it came from so many different people makes it cool.”

The Yankees now have two games to set the mark. Hicks said, “We’re not done yet.” He meant hitting homers in the regular season. But for these Yankees to overcome all that so often bedevils them, they are going to need to keep going deep if they want to go long into October.