NEW YORK (AP) — Matt Joyce went down at the plate and put Tampa Bay up.

Joyce hit a three-run homer in the ninth inning off fill-in closer David Robertson, falling on a twisted ankle as he finished his swing, and the Rays rallied to beat the New York Yankees 4-1 on Wednesday night.

READ MORE: President Joe Biden Signs Inflation Reduction Act Into Law

“It was the best and worst feelings that you could possibly have in the span of a minute,” Joyce said. “It’s always great to come up with a big hit like that, especially against the Yankees. It’s just hard to celebrate when you’re laying on the ground.”

Joyce, who struck out earlier with the bases loaded, drove a 1-2 pitch into the first row of seats beyond the short porch in right, giving Tampa Bay a 4-1 lead and snapping the club’s 0-for-20 drought with runners in scoring position.

It was a painful swing. Joyce rolled his left ankle and crumbled across home plate, then got up and trotted gingerly around the bases.

“I kind of told myself I had to,” he said. “You can’t really have somebody else pinch run for you there. There’s really no other option.”

Incidentally, had Joyce been seriously injured and unable to continue, the rules actually do allow for a pinch runner to complete the home run trip.

So was it Kirk Gibson hobbling home in the 1988 World Series? Not quite.

But it sure was fun for the Rays.

When he returned to the dugout, Joyce took plenty of ribbing from his teammates. He taped up his ankle and stayed in on defense but said he’s not sure yet if it’s sprained.

Fernando Rodney (2-0) pitched two scoreless innings and Tampa Bay snapped a three-game skid.

New York nemesis Jeff Niemann allowed six hits in a season-high seven innings. The right-hander is 3-0 in six career starts against the Yankees.

“Everything was working,” Niemann said. “It’s a lot of first-pitch strikes and just a lot of early action and that’s what helps you go deep in games.”

Rays manager Joe Maddon was impressed.

READ MORE: A 10-Year-Old Boy Has Part Of His Leg Amputated After Shark Attack

“That was dominating in a sense,” he said. “That’s the Niemann I’m used to seeing.”

In his first chance since taking over for injured Mariano Rivera, Robertson escaped a bases-loaded jam to save Tuesday’s 5-3 victory over the Rays. But one night later, New York got a chilling dose of real-life reality without Rivera.

“It’s the worst feeling in the world,” Robertson said. “You watch when Mo does it, he comes back the next day and he’s the same guy. He goes right back out there, takes the mound and does his thing. I’m going to have to do that tomorrow.”

With the Yankees clinging to a 1-0 lead, Sean Rodriguez singled through the left side on Robertson’s first pitch and went to third when pinch-hitter Brandon Allen singled to right on the next delivery.

Ben Zobrist walked and Carlos Pena, called out on strikes with the bases full to end Tuesday night’s game, went down looking again. B.J. Upton, however, lifted a sacrifice fly to right and Rodriguez scored with a nifty slide to tie it.

That was the first run charged to Robertson (0-1) in 27 outings since Aug. 29 last year in Baltimore.

Robinson Cano hit an RBI double in the first and Rafael Soriano escaped an eighth-inning jam against his former team, but the Yankees couldn’t hang on.

Earlier in the day, Rivera announced he’s receiving treatment for a blood clot in his right calf. The 42-year-old reliever, expected to miss the rest of the season, said he’s still determined to return next year.

He also said he was sweating and screaming at the television while watching Robertson labor to close out Tuesday night’s victory. This one must have been even tougher to take.

“I think he threw 25 or 26 pitches last night and it may have spilled over into tonight a little bit,” Maddon said. “The ninth inning is a different inning than the seventh or eighth inning. It’s a different inning based on emotion. The passion that inning possesses is just different. He’s going to be fine, he’s good. We just happened to get to him tonight.”

Yankees rookie David Phelps, making his second career start, held Tampa Bay to three hits but was pulled one out short of qualifying for his first major league win.

NOTES: Rays LHP David Price (5-1, 2.35 ERA) faces LHP CC Sabathia (4-0, 4.15) in a matchup of All-Star aces Thursday night. Price is 3-0 with a 1.56 ERA in five career starts against Sabathia, and Tampa Bay has won them all. … Rays INF Jeff Keppinger, placed on the restricted list after Tuesday night’s game due to a family matter, is expected back Thursday or Friday. … Tampa Bay LF Desmond Jennings (sprained left knee) is close to returning to the starting lineup, Maddon said. Jennings flied out as a pinch hitter to end the eighth.

MORE NEWS: A Florida Judge To Hold Hearing Tuesday On Request To Unseal Mar-A-Lago Affidavit

Copyright 2012 The Associated Press.