Gardner slapped a single to left field to score Robinson Cano for a 13-inning, 3-2 victory over the Royals in a 4-hour, 53-minute contest that began in front of a sellout crowd of 54,180.
Cano blooped a single to right against right-hander Jeff Fulchino with one out in the 13th. Ivan Rodriguez grounded into the second out, Cano taking second, before Gardner singled on a 3-2 pitch.
"I just lost control of that at-bat. I went from 0-2 to 3-2 and went from being in the driver's seat to being in the back seat," Fulchino said.
Gardner, a left-handed batter, came into the game with a .143 average. But he was having a good day with two hits and a walk when he came up against Fulchino.
"I got behind 0-2 within a period of about 15 seconds, and I was like, 'Oh no, not this again.' And then he just missed on a couple fastballs," Gardner said.
"I kept waiting on him to throw me a split, and then when he got to 3-2, I said to myself there's a pretty good chance I'm going to get a fastball right here, because he'd rather face me than Johnny [Damon]."
Gardner grounded a single through the hole between short and third and left fielder David DeJesus charged in.
"The ball was getting eaten up by the grass," DeJesus said. "I kept charging and charging and, with two outs, he had a good jump."
DeJesus threw home, but Cano crossed the plate easily to end the game.
"It's a walk-off, it's a base hit and David didn't position himself shallow enough in left field to make a play at home plate," Royals manager Trey Hillman said. "It wasn't even close."
Wasted was a fine pitching performance by Zack Greinke, who worked six scoreless innings and held a 2-0 lead. Alex Gordon's 14th homer and Esteban German's sacrifice fly provided the runs against Yankees starter Sidney Ponson.
But the Royals' defense betrayed Greinke in the seventh, and the Yankees tied the score, 2-2.
Gordon made a double error at third base. He bobbled Alex Rodriguez's grounder, then made a wild throw to put A-Rod at second. Giambi walked, but Xavier Nady bounced into a double play.
Cano rifled a triple off the right-field wall for one run. Greinke's next pitch was in the dirt and bounced away from catcher John Buck, allowing Cano to score.
"Before that last inning, the defense made some great plays and made it a lot easier for me," Greinke said. "I mean, I could've come through one time when they had a bad inning. And I pitched real bad to Cano. That was a big at-bat, and I didn't make one good pitch the whole time."
Even though his wild pitch was in the dirt, Greinke had confidence that Buck would snatch it up.
"When it happened, it kind of shocked me," Greinke said. "Even though I threw it in the dirt, it was surprising for how well he's caught all year."
Buck thought he should have had it.
"He was pitching very well. We didn't do him any favors," Buck said. "The defense just wasn't there for him today."
After the wild pitch, Ivan Rodriguez's ground ball was booted by shortstop Tony Pena for another error. The inning was prolonged, and when the pesky Gardner singled, Greinke's outing was over and the bullpen took over. Both runs against him were unearned.
And the 'pen did very well, too. Ramon Ramirez, Robinson Tejeda and Joel Peralta combined for 5 1/3 scoreless innings, as the game stretched into extra innings and the Yankee Stadium shadows stretched toward the mound.
Only Fulchino, among the relievers, was dented.
"Today was a matter of pitching very well and, offensively and defensively, we stunk," Hillman said. "We wasted some great stuff by Zack."
Dick Kaegel is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.