Jhonny Peralta's solo home run in the bottom of the eighth helped give the Tigers a 5-4 win against the Indians on Wednesday night, keeping alive hopes for home-field advantage in the American League Division Series.

The Tigers needed the Rangers to lose to the Angels in order to host Game 1 of the ALDS on Friday, but Mike Napoli's ninth-inning homer lifted the Rangers to a 3-1 victory and the No. 2 seed in the playoffs.

Detroit, as the No. 3 seed, will face the Yankees in a best-of-five series beginning on Friday night at Yankee Stadium.

Tigers starter Rick Porcello retired the first seven batters he faced, but a walk to Matt LaPorta and a triple from Ezequiel Carrera gave the Indians a 1-0 lead in the third inning.

In the fourth, Porcello found more trouble. Asdrubal Cabrera and Travis Hafner led off the inning with singles and Carlos Santana was walked to load the bases with no outs. The Indians were able to plate two runners on a Jack Hannahan single and LaPorta reached on a fielding error from Wilson Betemit.

The Tigers' comeback began in the bottom of the fourth, when a single from Victor Martinez scored Delmon Young from third base.

In the fifth, Miguel Cabrera, Martinez and Alex Avila hit three straight singles to cut the deficit to 3-2, and a sacrifice fly from Jhonny Peralta tied the game at three.

After allowing a leadoff double in the seventh, Porcello's day was done. But Al Alburquerque was able to strand the runner, making it the fifth straight start in which Porcello gave up three earned runs or fewer.

The Tigers took the lead in the seventh, when Wilson Betemit scored on a wild pitch after leading off the inning with a triple.

But Ryan Perry blew the lead in the eighth. After getting a groundout, Perry gave up a double to Hafner and walked Santana and Shelley Duncan to load the bases. A sacrifice fly from Hannahan tied the game at four before a groundout ended the inning.

Miguel Cabrera went 2-for-4 in the game, raising his batting average to .344 as he looks to win the American League batting title.

Jose Valverde closed out his 49th straight save.