ST. PETERSBURG, Fla. — Manuel Margot flared a run-scoring single to right field to complete a two-run rally in the bottom of the ninth inning, and the playoff-bound Tampa Bay Rays beat the Los Angeles Angels 5-4 on Thursday

Tampa Bay, which holds the top AL wild card, started the day 2 1/2 games behind AL East-leading Baltimore, which holds the tiebreaker. The Orioles, whose magic number to win the division remained seven, play at Cleveland on Thursday night.

Pinch-hitter Harold Ramírez and Yandy Díaz started the ninth with singles off Angels closer Carlos Estévez (5-5). Ramírez went to third on Curtis Mead’s fly ball and scored to tie it at 4 on Isaac Paredes’ single.

After Randy Arozarena struck out and Josh Lowe walked to load the bases, Margot delivered his opposite-field game-winning hit.