TORONTO — Ryan Goins pulled off a hidden ball trick and hit his second career grand slam, leading the Toronto Blue Jays over Masahiro Tanaka and the Yankees 8-1 Friday night and ensuring New York had to wait at least one more day to clinch a playoff berth.

With Todd Frazier on base following a leadoff double in the third, Jose Bautista made a running catch just in front of the right field warning track on Jacoby Ellsbury’s one-out drive. Goins caught Bautista’s throw while standing near second base, then pretended to toss the ball to pitcher Marco Estrada while slipping it into his glove.

Goins turned his back to Frazier, who had returned to the base, and when Frazier briefly lifted his left foot off the base, Goins tagged him on the left thigh.

Frazier insisted he had maintained contact with the base, but umpire Mark Carlson called him out to end the inning.

Goins, Russell Martin and Teoscar Hernandez homered off Tanaka (12-12).

TWINS 7, TIGERS 3: Max Kepler and Brian Dozier homered, Byron Buxton had three hits and playoff-chasing Minnesota won at Detroit.

Buxton’s two-run double in the fourth put the Twins ahead to stay.

Kyle Gibson (12-10) allowed three runs and five hits in seven innings for Minnesota. He struck out six and walked two.

RAYS 8, ORIOLES 3: Wilson Ramos hit his third career grand slam, Evan Longoria also went deep and Tampa Bay throttled Ubaldo Jimenez in a victory at Baltimore.

Alex Cobb earned his career-high 12th win for the Rays, who interrupted a 4-9 slide and kept alive their slim playoff hopes.

Ramos connected in the second inning and Longoria homered in the third for a 5-2 lead. Both drives came off Jimenez, who likely pitched his final home game with the Orioles following a rocky four-year stint.

NATIONAL LEAGUE

CARDINALS 4, PIRATES 3: Randal Grichuk scored after an error by Pirates shortstop Jordy Mercer, capping a frantic ninth-rally that lifted surging St. Louis to a win at Pittsburgh.

The playoff-chasing Cardinals won their fifth straight, despite trailing by a run entering the ninth.

Stephen Piscotty led off with a double to right against closer Felipe Rivero (5-3), and Jedd Gyorko followed with a pinch RBI single. After Tommy Pham’s single, Grichuk pinch-ran for Gyorko at third. He scored when Mercer misplayed Dexter Fowler’s sharp groundball.

METS 7, NATIONALS 6: Travis d’Arnaud hit two home runs and the Mets ended a three-game skid, rallying past a watered-down Washington lineup at New York.

Nationals Manager Dusty Baker said he needed to “give my big boys much needed rest” with the playoffs nearing, and not a single regular started for the NL East champions.

BRAVES 7, PHILLIES 2: Kurt Suzuki homered twice, Nick Markakis drove in three runs and Atlanta won at home.

Sean Newcomb (4-8) won his second straight start, allowing two runs, four hits and two walks in 51/3 innings.