Stanton had been out because of a strained left quadriceps. He was slated to bat second as the designated hitter against the Tigers.
Stanton hadn't played since May 13. He hit .282 with nine home runs and 24 RBIs in his first 33 games this season.
"He's been doing well, and definitely good to have him back," Yankees manager Aaron Boone said before the game. "Obviously his power is prodigious. I think what's been really impressive about him this year to me is just the quality of at-bat we've been getting."
Boone said reliever Aroldis Chapman was available again after he'd been dealing with an illness.
Stanton hit 38 home runs in 2018, his first season with the Yankees. Then he managed only seven homers in 41 games over the next two years combined -- so his health is hugely important for New York.