NEW YORK -- Derek Jeter had no doubts he was ready to return and, one pitch into his second comeback of the season, he showed it.

The Yankees captain homered in his first at-bat Sunday as the Yankees avoided being swept with a 6-5 win over the Tampa Bay Rays.

Jeter finished 2-for-4 with an RBI and two runs scored as the Yankees won on a game-winning single in the ninth from Alfonso Soriano.

"I said, 'Thank God,' because I didn't want to go out there and play in extra innings because I was tired," said Jeter who spent most of his postgame news conference deflecting questions about himself as he tried to put the focus on Hideki Matsui, who officially retired as a Yankee on Sunday.

Jeter, who started at shortstop and batted second Sunday, stepped to the plate to the familiar recording of legendary Yankee public address announcer Bob Shepard's voice and a standing ovation.

Jeter then nailed a Matt Moore fastball the other way, just over the wall in right field.

Robinson Cano, the next batter due up, waited for Jeter to acknowledge the second standing ovation. Jeter quickly appeared at the top step and waived to the crowd.

"He's a movie," Yankees manager Joe Girardi said.

It was the first Yankee homer by a right-handed hitter since June 25, a span of 28 games and the first in second half. Since the All-Star break, the Yankees are 4-6 and have had trouble scoring runs.

"We need contributions from a lot of people," Jeter said. "It is not like I'm some savior."

Jeter was eligible to come off the disabled list on Saturday. Instead, the Yankees shrouded Jeter's final tuneup, a simulated game in Staten Island, in secrecy, only revealing it after Jeter had successfully completed his work against Single-A competition.

"It wasn't my idea," Jeter said before the game. "They wanted to see some things. For me, I didn't have any doubts."

Prior to Sunday, the 39-year-old Jeter had missed all but one of the Yankees' games because of a twice-fractured ankle and strained quad.

Jeter missed the first 91 games of the season before coming back as a designated hitter and going 1-for-4 on July 11 against the Kansas City Royals. He strained the calf running the bases that day and has been out since.

Girardi would like Jeter to "run under control," at least until the injury heals.