BUFFALO, N.Y. (AP) - Giancarlo Stanton hit a go-ahead homer in a four-run seventh inning and the New York Yankees pulled off a wacky triple play Thursday night in an 8-4 win over the reeling Toronto Blue Jays.

Stanton broke a 3-all tie with his 13th homer, an opposite-field, two-run shot off Anthony Castro (1-2). The triple play in the first inning marked the first time the storied Yankees franchise turned two in one year.

Chris Gittens drove in three runs, and Gio Urshela had three hits and scored three runs for New York, which swept the three-game series and finished 5-3 on its road trip. Chad Green (1-4) was the winning pitcher.

Reese McGuire had three hits and Santiago Espinal scored twice for Toronto, which has lost four straight and six of eight. Randal Grichuk gave the Blue Jays a 4-3 lead in the sixth with an RBI single, bringing them back from a 3-0 deficit.

Later in the sixth, Aaron Judge robbed Cavan Biggio of a home run, reaching over the right-field wall to record a 358-foot out.

It wasn't the Yankees' only significant defensive play, as New York turned its triple play mere weeks after pulling one off May 21 against the Chicago White Sox.

Yankees starter Michael King had runners on second and third with no outs when Vladimir Guerrero Jr. hit a tapper to King, who threw to first for the out. First baseman DJ LeMahieu then threw to shortstop Gleyber Torres at second base, with both Toronto runners in limbo.

Torres threw to catcher Gary Sanchez, who tossed to third baseman Urshela for the tag on Marcus Semien between third and home. Urshela alertly threw back to Torres, who tagged Bo Bichette as he slid into third on a close play that had be reviewed.

The 1-3-6-2-5-6 sequence was the first time that combination was used in any of the 726 triple plays in major league history, per a list maintained by Baseball Almanac.

Blue Jays left-hander Taylor Saucedo made his major league debut and had a strikeout in one inning.

RIGHT AT HOME

The three-game series, played at Toronto's temporary home in Buffalo, drew crowds predominantly clad in Yankees gear and cheering as if the Blue Jays were the visitors. Both managers noticed the difference.

“It's been definitely unique,” Yankees skipper Aaron Boone said. “You can definitely feel their presence and the excitement. It's been nice to hear them behind us and know how excited they are to see us come in. That's been pretty cool to witness.”

Toronto manager Charlie Montoyo had a more resigned reaction.

“The first week here it was really cool, the support we had,” Montoyo said. “It is what is is and we're gonna deal with it. But of course it felt weird.”

YANKEES DEAL FORD

The Yankees traded 1B Mike Ford to the Tampa Bay Rays for $100,000 and a player to be named. Ford had been designated for assignment Saturday when reliever Zack Britton was activated from the injured list.

TRAINER'S ROOM

Yankees: Torres left after three innings with lower back stiffness and will undergo further evaluation Friday. ... RHP Darren O'Day (strained rotator cuff) had another bullpen and will throw another one Friday or Saturday before starting a rehab assignment. ... LHP Justin Wilson (strained right hamstring) is slated to do some bullpen work Friday.

Blue Jays: RHP Carl Edwards Jr. (strained oblique) was transferred to the 60-day IL to make room on the roster for OF Jared Hoying, who was promoted to the active roster. ... RHP Rafael Dolis (strained right middle finger), who left Wednesday's game after four pitches, was placed on the 10-day IL to make room for Zeuch. ... OF Teoscar Hernandez was placed on the paternity list. ... OF George Springer (quad strain) played six innings in center field in a rehab game for Triple-A Buffalo and went 1 for 4 with an RBI double in Rochester. He is 2 for 12 in three rehab games.

UP NEXT

The Yankees return home Friday to face Oakland. RHP Jameson Taillon (1-4, 5.74 ERA) pitches against Athletics RHP James Kaprielian (3-1, 2.51).

Toronto travels to Baltimore, where LHP Robbie Ray (4-2, 3.45) opposes Orioles LHP Bruce Zimmermann (4-4, 4.83) in the series opener.