ST. PETERSBURG, Fla. — Josh Lowe hit a three-run homer and a walk-off single that capped a two-run ninth inning, lifting Tampa Bay over the Toronto Blue Jays 7-6 on Saturday after the Rays wasted a five-run lead.

Yandy Díaz had four hits, and Díaz, Lowe and Christian Bethancourt homered for the Rays (95-61), who ensured themselves no worse than the top AL wild card. The Rays started the day 1 1/2 games behind AL East-leading Baltimore, which is playing at Cleveland.

Rays prospect Junior Caminero made his big league debut at 20 years, 80 days and went 1-for-4 with a walk. He beat out what would have been an inning-ending double play grounder in the ninth — the initial out call by first base umpire Alex Tosi was reversed in a video review. Lowe then sliced an opposite-field single down the left-field line off Jordan Romano (5-6), who blew a save for the fourth time in 40 chances.

Toronto (86-69) began the day holding the second AL wild card, one game ahead of Texas and 1 1/2 games in front of Seattle, which played at the Rangers on Saturday night.

The Baltimore Banner thanks its sponsors. Become one.

With the Blue Jays trailing 6-5, Díaz doubled leading off the ninth, took third on Harold Ramírez’s single and scored on Curtis Mead’s single. Díaz, second in the AL batting race, raised his average to .327,

Toronto trailed 5-0 and was down 5-4 in the eighth when Pete Fairbanks threw a run-scoring wild pitch, walked Vladimir Guerrero Jr, and Cavan Biggio, hit Matt Chapman with a pitch and forced in a run with a walk with Whit Merrifield. Fairbanks has blown four of 28 save chances.

Díaz hit leadoff homer and Lowe added a three-run drive in a four-run first against Hyun Jin Ryu. Bethancourt made it 5-0 on his fourth-inning homer.