DETROIT — After a stunning loss on Tuesday when they blew a six-run lead and a rainout on Wednesday, the Yankees finally beat the Tigers Thursday afternoon.

They opened a doubleheader at Comerica Park with a 10-4 win over Detroit, backed by a pair of two-out, two-run homers by Luke Voit and Edwin Encarnacion.

But the victory came with another significant price, as Encarnacion later left the game with a left oblique strain, a potentially serious blow to their offense the rest of the season.

And their pitching looked a lot like what it might look like in the playoffs, as J.A. Happ didn’t complete five innings before Aaron Boone turned to his bullpen, which secured the victory.

The Yankees took a 2-0 lead in the first when Voit hit a 449-foot homer, his first since July 22, following an error by Dawel Lugo that allowed Aaron Judge to reach base.

Voit’s power numbers have slipped considerably since his return from a sports hernia that could still require surgery following the season.

He added a double in the seventh.

Encarnacion added his shot in the third to make it 4-0. Serving as the DH, Encarnacion walked in the fifth and then was removed from a two-run game for pinch-hitter Mike Ford in the seventh.

The Yankees had the bases loaded with one out in the fifth, but Voit flied to right and Didi Gregorius struck out to end the threat.

And Happ’s scoreless-inning streak ended at 20 in the bottom of the inning.

The lefty retired the first two batters of the inning before Ronny Rodriguez singled to left and Lugo homered to right-center to make it 4-2.

Happ then gave up a single to Christin Stewart to end his day after 99 pitches. Chad Green came on and pitched 2 ¹/₃ innings.

The Yankees added to their lead in the seventh.

With the bases loaded and one out, Bryan Garcia’s wild pitch scored Judge. Cameron Maybin’s double to right-center padded their lead to 7-2.

Jeimer Candelario led off the bottom of the inning with a triple off Green. DJ LeMahieu made a spectacular leaping grab of Miguel Cabrera’s liner to second. Candelario scored on a Ronny Rodriguez groundout.

The Yankees scored three more times in the eighth with a two-run triple by Gregorius.

After widening their lead, Boone went to Ben Heller, who hadn’t pitched for the Yankees since 2017, as he came back from Tommy John surgery. He gave up a run in his lone inning of work.