Teixeira went 3-for-5 and helped keep the Yankees three games behind Boston in the chase for the top spot in the American League East.
Curtis Granderson gave Detroit a 3-1 lead in the fifth with a solo homer, but the Yankees closed to within one in the bottom half of the inning thanks to an unearned run. Detroit left fielder Josh Anderson misplayed a single by Teixeira, allowing Johnny Damon to score.
With the Tigers clinging to a 3-2 lead in the seventh, Derek Jeter reached on a leadoff single off Joel Zumaya (3-3) and Damon doubled him to third. Teixeira followed with a homer to right, his 22nd of the year.
The comeback made a winner out of Phil Hughes (4-2), who did not allow a run in two innings of relief. All six batters Hughes retired struck out.
Following a 57-minute rain delay in the eighth, Mariano Rivera came on in the ninth for his 24th save.
Copyright 2009 by United Press International.