Andrew Romine pinch ran and trotted home when Cabrera hit his seventh career game-ending homer into the right-field stands.
Jumbo Diaz came out of the bullpen and got Victor Martinez to hit a routine grounder to short, but it went under Robertson's glove, allowing Avila to score the go-ahead run.
RHP Brad Boxberger (flexor strain) struck out the side in the seventh inning while making his first rehab outing.
Tigers: Top relief prospect Joe Jimenez (back) was activated from the disabled list Thursday and pitched a scoreless inning for High-A Lakeland.
Jimenez, who made his major league debut in April, is expected to return to Triple-A Toledo after another outing in Lakeland.
- Series Preview: Rays head to MotownDRaysBay
- Live Tigers blog: Cabrera, Tigers walk off, 5-3 over RaysThe Detroit News (blog)
- Tigers vs. Rays: Live scoring, stats, chatMLive.com
- Tigers vs. Rays Series Preview: It's do-or-die time for the 2017 TigersBless You Boys (blog)
- Cabrera's game-ending homer gives Tigers winWOODTV.com
- Tigers vs. Rays Preview: We're still waiting for Justin Verlander to get back ...Bless You Boys (blog)
- Rays vs Tigers Preview: Let's play four in DetroitDRaysBay
- For starters: Rays at Tigers, with Alex Cobb pitching, and clearing skiesTampabay.com (blog)
- Michael MartineznumberFire