Updated

While Mariano Rivera continues to struggle, Brett Gardner keeps picking his teammate up.

Gardner's solo home run with two outs in the bottom of the ninth inning lifted the New York Yankees to a 5-4 victory over the Detroit Tigers, a game in which Rivera blew a third consecutive save opportunity.

One of those failures came in Friday's opener of this three-game set, when Miguel Cabrera socked a game-tying two-run homer off Rivera (3-2) in the ninth inning. Two days later, the legendary closer surrendered a pair of solo shots -- one to Cabrera and one to Victor Martinez -- in the top of the ninth to squander a 4-2 Yankee lead.

"The only thing we can explain is that we lost the game. That's all that matters right now. It's about getting it done and trying to win games," Cabrera said. "At the end of the game, the home runs mean nothing to us."

Gardner also had the deciding hit, an RBI single in the 10th inning, in Friday's 4-3 verdict over Detroit.

Alex Rodriguez came through with two big hits, a solo home run and an RBI single, in by far the Yankee slugger's most productive game returning from offseason hip surgery earlier in the week. Alfonso Soriano also homered for New York -- his 2,000th career hit.

Martinez finished 3-for-5 and Brayan Pena also collected three hits, including a solo homer, but the Tigers lost a series for the first time since dropping two of three at Kansas City from July 19-21. Detroit had won 13 of 14 entering Sunday's matchup.

Cabrera greeted Rivera with an opposite-field blast into the bleachers to begin Detroit's rally. Two batters later, Martinez launched a cutter into the middle deck in right, though Rivera got the next two men out to keep the score at 4-4.

"You're facing professional hitters. If you don't put the ball where you need to, you're going to get hit," Rivera said.

Detroit's Jose Veras (0-5) set down the first two hitters in the bottom of the ninth, but Gardner got all of a 1-0 pitch to end a string of eight straight series in which the Yankees either lost or tied.

Pena had pulled the Tigers within 4-2 by connecting off of David Robertson when leading off the eighth.

Rodriguez was held out of Saturday's game after an 0-for-4, three-strikeout performance in the series opener, and the day off appeared to pay off. He belted the second pitch he saw from Justin Verlander four rows deep into the left-field seats to tie the game at 1-1 in the bottom of the second. It was his first major league homer since September 14 of last season.

Lyle Overbay followed with a single, took third on a Curtis Granderson base hit and crossed home on Eduardo Nunez's fly to center to send New York in front.

Rodriguez delivered again in his next at-bat, sending a ground-ball single down the right-field line that plated Robinson Cano, who kept the Yankees' half of the third alive with a ground-rule double to left.

Soriano made it a 4-1 game an inning later, crushing Verlander's hanging slider for his milestone homer.

The Tigers, meanwhile, had New York starter Andy Pettitte on the ropes for much of the afternoon, but weren't able to come up with the big hit on several occasions.

Detroit put four of the game's first five hitters on base and grabbed a quick 1-0 edge when Prince Fielder brought in Torii Hunter with a single. A Martinez hit then loaded the bases, but Pettitte got Matt Tuiasosopo to ground right to Rodriguez to start a double play that prevented further damage.

The Tigers, who stranded two more runners in the second as well as a pair in the fourth, loaded the bases with one out once again in the fifth on a Cabrera double, a Martinez single and a walk to Tuiasosopo that triggered Pettitte's exit. Shawn Kelley came on to record a big strikeout of Hernan Perez before retiring Pena to protect New York's three-run advantage.

Pettitte allowed just one run despite lasting just 4 1/3 frames, while Verlander worked seven innings and surrendered four runs while striking out nine.

Game Notes

Rodriguez's two RBI gave him 1,952 for his career, moving him past Stan Musial and into sole possession of fifth place on baseball's all-time list ... Soriano became the 16th active player to reach the 2,000-hit mark ... Pettitte has now allowed a first-inning run in a Yankee record eight consecutive starts ... Robertson had a string of 20 1/3 scoreless innings end on Pena's homer ... The Tigers have now lost nine of their last 12 at Yankee Stadium and haven't taken a series from New York on the road since 2008.