MINNEAPOLIS -- Andy Pettitte's performance had been too good to waste, something the Yankees knew long before Nick Swisher gambled on a hanging changeup and belted it far past the right-field wall.

Swisher's go-ahead homer off Jon Rauch gave the Yankees a 3-2 lead over the Twins at Target Field on Wednesday, an edge that they would turn into a victory when Mariano Rivera slammed the door for his second save in less than four hours.

Yet it was Pettitte's gritty escape from a first-and-third, none-out situation in the eighth inning that saved the day, sending the lefty charging off the mound with a lot of extra pep in his step.

"It was intense, you know?" Pettitte said. "Late in the game, I'm not in there. If I go through a situation like that, it's usually in the third, fourth or fifth [innings], where it's really not that big of a deal. There was no doubt I got a little excited out there."

The Yankees had plenty to be thrilled with, having recorded two victories in the span of 13 innings at the Twins' spacious new ballpark. Derek Jeter homered and made a key sixth-inning defensive play in the continuation of Tuesday's rain-suspended contest, helping nail down a 1-0 victory in the first game.

New York has now beaten the Twins in 11 of the past 12 games between the two teams, though the most recent one was characteristically close.

"You have to win these kinds of games if you're going to do what we did last year," Mark Teixeira said. "If you're going to win a division and win a World Series, you have to win close games. You're not going to outscore everyone every single night. We've proven over the last two days here that we can win those games."

Pettitte had to wriggle out of trouble in the eighth, as Drew Butera's first career double pelted the heel of Brett Gardner's glove and Denard Span followed with a bunt that Alex Rodriguez charged but couldn't scoop, leading to an error.

Orlando Hudson blasted a rocket back to the mound that Pettitte flagged for the first out. Pettitte then ran the count to 3-1 on the always-dangerous Joe Mauer, who smashed a ground ball to Jeter at shortstop to begin an inning-ending double play.

"How impressive was that?" Swisher said. "That double play, reigning AL MVP up, first and third and one out. I'm saying to myself, 'Dude, just hit a rocket to somebody on the infield and we can turn two.' And that's exactly what happened."

"If there's somebody that can get out of that jam like that, it's Andy," said Rivera, who induced three pain-free ground balls in the ninth. "He made the pitches and used all of his composure to get it done. I've seen it over and over."

Pettitte's escape set the stage for Swisher, who said he took a chance and swung as hard as he could when Rauch gave him a changeup to hit. The result was a 381-foot blast that landed in the seats past the right-field wall, his eighth of the season. A Twins fan sent it back on to the field as Swisher rounded the bases, and it took quite a heave.

"It is a big ballpark, don't get me wrong," Swisher said. "But I talked to some of the guys on the Twins earlier, and they were saying that the ball does travel down the lines. It's 403 [feet] in right-center and there's a 30-foot wall. You've got to be a grown man to hit it out of there. I've got to go down the lines, you know?"

After the Twins were held scoreless by New York in the earlier completion of Tuesday's game, Minnesota got to Pettitte for a first-inning run as Span led off with a double, stole third base with one out and scored on Mauer's single, which came on a pitch that Pettitte didn't think Mauer could handle.

"You don't know how he does it -- he's amazing to watch," Pettitte said. "He's like Derek. He can take balls that other hitters can't handle and hit them the other way. Him and Derek are about the only two guys that I see hit like that."

The Twins tied the game against Pettitte in the seventh. Michael Cuddyer stroked a one-out hit to center and came all the way around on Delmon Young's double to the warning track in center field, sliding home safely to knot the game at 2.

"We're losing games against this team, but not by a lot," Span said. "We just have to find a way when we play this team to take advantage of the opportunities that we do get and just the little things. The little things against the Yankees win games."

Kevin Russo was the Yankees' toughest customer against Twins starter Francisco Liriano, getting to the left-hander for a game-tying double in the fourth inning after Francisco Cervelli beat out what could have been an inning-ending double-play ball.

Russo -- who also made a running catch to rob Mauer in the fourth -- added a two-out single in the sixth, which led to a run when Gardner laced a bullet triple down the right-field line. Liriano allowed two runs on eight hits, walking two and striking out seven, but it was good only for a no-decision. The Yankees saw to that.

"Right now, a win is a win," Swisher said. "At the end of the day, it's either a 'W' or an 'L.' The way Liriano pitched tonight, that definitely makes it tough. You're not going to score too many runs with a guy like that."