OAKLAND -- There were so many reasons that Marco Scutaro shouldn't have been able to hit a walk-off home run on Sunday afternoon.

For one, he was facing perhaps the greatest closer of all time in Mariano Rivera, a man with 413 career saves. Scutaro came into the game 0-for-5 in his career against the Yankees closer.

There was also the fact that Scutaro was 1-for-20 on the season, good for a batting average of .050.

But Scutaro has a flair for the dramatic.

For the ninth time in his four years in Oakland, Scutaro delivered a game-winning hit, hitting a three-run home run off the left-field foul pole with two outs in the ninth inning to give the A's a 5-4 win.

"I think some people have a knack for getting big hits, and he's had that for us since he's been here," A's manager Bob Geren said. "He takes his hitting very seriously, I have a lot of confidence in him and we're very fortunate to have him."

Sunday's was Scutaro's second walk-off home run as a member of the A's, with the first coming in August 2004 against Baltimore.

"This has to be in the top two," Scutaro said. "Especially being against Mariano, it was very special.

"I can't believe it, still. I was just praying that it didn't go foul. I knew I wasn't going to get another pitch like that."

Rivera had Scutaro down in the count, 0-2, and left one of his patented cut fastballs out over the plate. Scutaro didn't miss it.

"I just went up to make good contact," Scutaro said. "I wanted to go up, take three swings and see what happens."

The ninth inning appeared to be vintage Rivera, as he took over with a 4-2 lead and retired the first two hitters routinely.

"It just shows you that even the best can give it up," Geren said of Rivera. "Two outs against Rivera doesn't always look real good."

After Eric Chavez grounded out and Bobby Crosby flied out, Todd Walker lined a two-out single to left. Catcher Jason Kendall followed Walker's hit with a disciplined at-bat, laying off a 3-2 pitch just above the belt to draw a walk.

"He battled and laid off some real good pitches," Geren said of Kendall.

Kendall's walk set the stage for Scutaro, who had struck out looking in two of his previous three at-bats, all against Yankees starter Andy Pettitte.

"There's a certain type of player born for the dramatic, and he's that guy," Nick Swisher said of Scutaro. "We were saying today that he had a couple of good swings against [Rivera] last night, and today he got him."

"He does some amazing stuff," A's starter Rich Harden said. "It was pretty exciting, especially against a guy like Rivera."

Harden pitched well for the six innings he was on the mound, but left in the top of the seventh due to tightness in his right shoulder. Harden gave up a leadoff double to Alex Rodriguez in the seventh and was then removed.

"It was more a precautionary [decision] than anything," Geren said. "When he felt the tightness, we felt it was the right move to take him out. We'll see how he feels tomorrow."

"It's nothing serious," Harden said. "I definitely felt it, but I'm not real concerned."

The Yankees were more than glad to see Harden leave, considering he had shut them out over six innings and struck out seven. Rodriguez scored in the seventh -- a run that was charged to Harden -- but at 1.42, Harden's ERA is hardly high after three starts.

Jay Marshall went the final 1 1/3 innings to pick up his first career win.

After Harden left, it was Jason Giambi and Jorge Posada -- two hitters Harden has contained in his career -- who did the damage. Through Sunday, Giambi is 0-for-8 against Harden, and Posada is 3-for-18.

Joe Kennedy replaced Harden, and Giambi immediately singled, moving Rodriguez to third. Posada's double down the left-field line plated Rodriguez, putting runners on second and third. Sacrifice flies from Robinson Cano and Melky Cabrera plated two more runs.

The Yankees went up, 4-2, in the eighth on a sacrifice fly by Rodriguez, but thanks to Nick Swisher, that's all it was.

With Johnny Damon on third and Derek Jeter on third, Rodriguez appeared to have hit a home run to center field, but Swisher didn't give up on it.

"I thought it was out as soon as he hit it," Swisher said. "I was just running hard and was looking to make a play. I looked up at the last minute, and it was coming down."

Swisher banged into the wall, making the catch and likely keeping Jeter from scoring, which proved to be critical in the ninth.

Swisher led a first-inning charge, nothing new for the A's, as they scored two runs off Pettite right away.

Shannon Stewart reached on an error by Jeter, then Swisher smacked a double into the left-field corner to put runners on second and third. Stewart scored on a sac fly by Bobby Kielty, and Swisher came home when Mike Piazza smashed a single off the glove of Cano.

But the A's offense soon went cold, collecting just three hits between the first and ninth innings while the Yankees rallied.

Oakland scored three runs on four hits in the first inning against the Yankees in Saturday night's 4-3, 13-inning loss, collecting just three hits in the final 12 innings of the game. Against Chicago on Wednesday, the A's scored three in the first and had just one hit the rest of the game in a 6-3 loss.