NEW YORK — Derek Jeter returned to the New York Yankees' lineup — again — with customary flair, making an immediate impact on a team desperate for power.

Jeter homered on the first pitch he saw from Tampa Bay's Matt Moore, connecting Sunday soon after being activated from the disabled list for the second time this month.

"It was fun — I'm tired," Jeter said. "I worked hard to try to get back on the field."

The captain's drive ended the Yankees' nine-game homerless drought and helped them beat the Rays 6-5 to avoid a three-game sweep. It was New York's first long ball by a right-hander since June 25.

Jeter received a loud ovation and came out for a very quick curtain call, waving his cap from the next-to-top step of the Yankees dugout.

"Derek provided a lot of spark for them," Rays manager Joe Maddon said.

The 13-time All-Star played shortstop for the first time this season and went 2 for 4 with an intentional walk and two runs scored. He was on base for Alfonso Soriano's two-run drive in the third and for his game-winning hit in the bottom of the ninth.

"A lot of great memories here with Sori," he said of his teammate from 1999 to 2003, "and it was almost like old times."

To make room for Jeter, the Yankees placed designated hitter Travis Hafner on the disabled list with a right rotator cuff strain. Hafner has slumped to a .205 average. He hit the last of his 12 homers on June 25, a span of 67 at-bats.

Jeter had his much-anticipated return July 11 — as the designated hitter — after missing the Yankees' first 91 games because of a twice broken ankle. He was first injured during the opener of the AL championship series in October.

But he sustained a Grade 1 strain of his right quadriceps running out a groundball against Kansas City and went right back on the DL.

Fourth in the AL East, the Yankees went 4-8 during his second absence and are 55-50. New York has scored fewer runs than all but three teams in the American League this season.

"Hopefully I can help in any way, but we need contributions from a lot of people," Jeter said beforehand. "It's not like I'm some savior coming in here all of a sudden we're just going to start winning."

Manager Joe Girardi hopes he'll be penciling the Yankees' career hits leader in the batting order nearly every day from now on.

"It changes our lineup. There's no doubt about that," he said. "And just his presence is important to this club. It's been important for such a long time."

A favorable schedule should help keep Jeter playing every day at the start. The Yankees have off days Monday and Thursday next week, then only play six games before their next open day.

Girardi said he's been preaching a cautious approach for Jeter when he runs the bases, at least in the first few games of his comeback, to protect the leg.

And despite having difficulty embracing the concept before the game, Jeter appeared to hold back a bit running out to grounders.

Jeter still wasn't endorsing the style of play afterward.

"I don't want to learn how to do it. I understand I have to do it, especially the first week or two," he said. "I feel awful doing it. I don't like doing it. I hope nobody watches me do it."

A career .313 hitter, Jeter was eligible to come off the disabled list Saturday but the Yankees instead had him participate in a simulated game that was shrouded in secrecy.

The location of the workout was not disclosed until after the Yankees' 1-0 loss to the Rays.

"I don't know, it wasn't my idea. They needed to see some things," Jeter said. "Evidently they saw what they needed to see."

NOTES: RHP David Phelps (forearm strain) said he will make his second rehab start Tuesday, for Double-A Trenton. ... Injured INF 3B Jayson Nix (strained right hamstring) should be activated when the Yankees visit the Dodgers on Tuesday.