Updated

Pinch-hitter Brennan Boesch hit a tiebreaking infield single with the bases loaded in the ninth off closer Rafael Betancourt and the New York Yankees snapped a five-game skid at Coors Field with a 3-2 win over the Colorado Rockies on Wednesday night.

Vernon Wells had a two-run homer in the first and scored the decisive run when third baseman Nolan Arenado couldn't throw out a hustling Boesch after a diving stop.

David Robertson (2-0) earned the win by working out of a jam in the eighth and Mariano Rivera pitched the ninth for his 12th save in 12 chances.

It's the first time New York has won in the Mile High City since June, 19, 2002. The Yankees also bounced back from a 2-0 loss the night before. They're now 29-9 in games following a shutout loss since manager Joe Girardi's arrival in 2008.

Wells began the ninth with a single off Betancourt (1-1) and was credited with a stolen base when shortstop Jonathan Herrera dropped the ball while applying the tag. Lyle Overbay drew a walk and Ichiro Suzuki sacrificed them over.

After an intentional walk to Jayson Nix to load the bases, pinch-hitter Travis Hafner struck out. Boesch sent a two-out sharp grounder to Arenado, who fielded it cleanly and came up throwing. First baseman Todd Helton thought Boesch was out and began heading to the dugout, but first base umpire Phil Cuzzi ruled him safe. Rockies manager Walt Weiss briefly argued, before returning to the dugout.

With their bench depleted, the Yankees had to get creative in the field for the ninth. So much so that Wells wound up playing third base. He fielded Carlos Gonzalez's slow hopper for the second out.

Rivera got Wilin Rosario to fly out to center to end the game.

The wind blowing in on a cool and damp night meant very little hitting for either team, just 10 combined hits. The only early offense was a pair of two-run homers, one by Wells on a 94 mph fastball from Juan Nicasio in the first and the other a drive off the bat of Helton in the second.

Robertson worked his way out of a one-out situation in the eighth when he plunked pinch-hitter Troy Tulowitzki, who was then replaced by Eric Young Jr. Young then stole second, but Herrera lined out to second and Dexter Fowler grounded out to first.

Chris Nelson's first hit with the Yankees came in the stadium that's quite familiar for him. Nelson, who was traded from Colorado to New York on May 1, snapped an 0-for-12 skid with a single in the seventh that Fowler misplayed and allowed Nelson to hustle to third. With two outs, pinch hitter Ben Francisco grounded out to third and stranded Nelson.

David Phelps was solid except the one hiccup to Helton. He lasted six innings and allowed three hits.

Like Phelps, Nicasio settled into a groove after encountering early trouble. He allowed two hits in the first — including Wells' seventh homer of the season — but only gave up a walk to the next 15 hitters he faced.

Nicasio went five innings in the no-decision, striking out five and walking one.

Girardi employed a different type of strategy on Wednesday, inserting pitcher David Phelps into the No. 8 spot in the batting order and moving catcher Austin Romine to ninth. Girardi borrowed the idea from former St. Louis skipper from Tony La Russa.

Girardi's tactic was a way to gain more favorable matchups deeper in the game against the Rockies' bullpen. It's the first time a Yankees pitcher has batted in a spot other than ninth since interleague play began in 1997, according to STATS.

The last Yankees pitcher to bat eighth was Don Larsen in 1957, STATS said.

Weiss decided to hold out Tulowitzki for a second straight game. Not so much because of soreness in his legs as the soggy weather. Weiss didn't want to take a risk with his All-Star slugger.

Tulowitzki said he ran earlier in the day and his legs "felt good." He missed most of last season with a groin injury that required surgery to remove scar tissue.

The Yankees are no strangers to players missing from the lineup, with shortstop Derek Jeter, first baseman Mark Teixeira, third baseman Alex Rodriguez and infield Kevin Youkilis all sidelined.

"Of course, they're a better team with them on the field. But they're still the Yankees," Gonzalez said. "They always find a way to win, always find a way to be competitors."

NOTES: Before the game, the Rockies presented Yankees closer Mariano Rivera with a $5,000 check for his foundation. ... The Yankees will send LHP CC Sabathia (4-3) to the mound Thursday in the series finale. The Rockies will counter with LHP Jeff Francis (1-2).