Thursday night at Fenway Park, the Yankees and Red Sox played a wonderfully dramatic game in their first meaningful September game since 2011. It’s been a while since these two teams were in contention at the same time.

The Yankees were well on their way to a win Thursday thanks to staff ace Masahiro Tanaka, who cruised through seven innings of one-run ball. He’s having a Cy Young-caliber season and showed exactly why Thursday. The Yankees handed a three-run lead over to Dellin Betances in the ninth, and usually that equals a win, but not this night.

Betances, who was working for the third straight day and was clearly fatigued, allowed a walk and two singles to trim the lead to 5-4. The BoSox also had the tying run at third.

That run scored, and more. Hanley Ramirez demolished a three-run walk-off home run for the 7-5 win (box score). Check it out:

If you’re a Red Sox fan, that’s easily the best win of the season. If you’re a Yankees fan, that’s a devastating blow for a team fighting for a postseason spot. No lead is ever safe in Fenway Park, but man, with Tanaka cruising and Betances on the mound late, the Yankees had to feel pretty good.

The loss dropped the Yankees to 2 1/2 games back of the Blue Jays for the second wild-card spot. The Red Sox, meanwhile, stretched their lead in the AL East to two games over the Orioles.

Source: CBS Sports / WATCH: Walk-off Red Sox homer delivers blow to Yankees’ postseason hopes