DENVER 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. They're 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 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.

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 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 off the bat of Todd 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.

Chris Nelson's first hit with the Yankees came in his former stadium.

Like David Phelps, Nicasio settled into a groove after encountering early trouble. He allowed two hits in the first but only gave up a walk to the next 15 hitters he faced.

Girardi inserted pitcher David Phelps into the No. 8 spot in the batting order.

Girardi's tactic was a way to gain more favorable matchups against the Rockies' bullpen. It's the first time a Yankees pitcher has batted eighth since 1957, according to STATS.