MINNEAPOLIS — Finally, the Yankees' offense helped one of its starters. And it happened when the club needed it most.

MINNEAPOLIS — Finally, the Yankees' offense helped one of its starters. And it happened when the club needed it most.

On a night when Andy Pettitte didn't have it for a fourth straight start, a struggling offense picked up the slack in a 10-4 victory over the Twins at Target Field that snapped a five-game losing streak.

"Definitely a much better feeling in here tonight than we've had in some time here," Joe Girardi said as music boomed from the clubhouse speakers after the game Monday night.

Robinson Cano hit two home runs and a double - making him 10-for-17 with three homers in his last four games - but the Yankees trailed 4-3 before picking up seven runs and seven hits in the final two innings.

Shawn Kelley, winning pitcher Joba Chamberlain, David Robertson and Mariano Rivera finished up with four scoreless innings after Chris Parmelee homered off Pettitte in the sixth to give the Twins a 4-3 lead.

Rivera pitched in a non-save situation after RBI singles by Travis Hafner and Zoilo Almonte, a bases-loaded walk to Chris Stewart and a run-scoring passed ball in the ninth gave the Yankees a 10-4 lead.

"Any time you're in a losing streak, you want to end it as soon as possible," Stewart said. "And the way we did it tonight, we came back in the eighth inning and put some good at-bats together and finally got those hits with runners in scoring position that we haven't been getting."

Considering the Yankees (43-39) had been limited to three or fewer runs in 20 of their previous 33 games, their 4-3 deficit in the eighth seemed immense. But they rallied against Jared Burton.

Cano led off by ripping a double into the gap in right-center. Ichiro Suzuki pinch hit for Vernon Wells and surprised everyone with a bunt single, putting runners at the corners. Burton threw over to first three times trying to keep Ichiro close and threw wildly on the third attempt, which tied it at 4 and sent Ichiro to third.

Blue Jays 8, Tigers 3

At Toronto, R.A. Dickey won again, Jose Reyes and Mark DeRosa homered and Toronto beat slumping Detroit for its seventh straight home win.

The Blue Jays delighted a sellout crowd of 45,766 on Canada Day with their 11th victory in 13 games at Rogers Centre.

Coming off his two-hit shutout against Tampa Bay, Dickey (8-8) was sharp and won for the third time in four starts. The knuckleballer allowed two runs and six hits in seven innings, striking out four and walking one.

Rays 12, Astros 0

At Houston, Matt Moore allowed two hits in seven innings for his 11th win and Ryan Roberts homered twice to lead Tampa Bay over Houston.

Moore (11-3) won his third straight decision and Cesar Ramos pitched two perfect innings to complete the two-hitter and help the Rays win their third in a row.

Roberts made it 3-0 with a two-run homer in the third off Dallas Keuchel (4-5) and tacked on another run with a solo shot in the eighth inning.

Sean Rodriguez had a career-high four hits — two doubles — with three RBIs, and three other Rays added three hits apiece on a night when they tied a season high for runs and finished with 17 hits.

National League

Nationals 10, Brewers 5

At Washington, Bryce Harper homered on his first swing since coming off the disabled list and his Washington Nationals teammates quickly joined in, beating slumping Milwaukee.

After missing 31 games with bursitis in his left knee — the most lingering fallout from his collision with the Dodger Stadium wall — Harper energized the Nationals and sparked their second rout in two days. After toying with .500 for the entire month of June, Washington moved two games above the break-even mark for the first time since late May.

Jayson Werth had five RBIs, and even pitcher Jordan Zimmermann was an offensive juggernaut with a team-high three hits, including a double to start a five-run third inning and a single to open a two-run fourth.

Reds 8, Giants 1, 6 innings

At Cincinnati, Todd Frazier homered and drove in four runs, leading Cincinnati out of its offensive slump to a victory over San Francisco in a game shortened to six innings because of rain.

Frazier had an RBI single and a three-run homer off left-hander Mike Kickham (0-3), who has been hit hard in each of his three major league starts.

Bronson Arroyo (7-6) gave up a pair of hits in six innings, including Brandon Belt's homer.

Marlins 4, Padres 0

At Miami, Jose Fernandez struck out 10 and allowed only two hits in a career-high eight innings as Miami beat San Diego to match a season high with its third consecutive victory.

Jeff Mathis delivered the big hit for the second game in a row, raising his batting average to .154. He hit a three-run double in the sixth, when the Marlins scored four unearned runs off Jason Marquis (9-4), who issued a career-high seven walks in 61/3 innings.

Mets 5, Diamondbacks 4, 13 inn.

At New York, Andrew Brown hit a two-run single with two outs in the 13th inning and the New York Mets put together a pair of late rallies to hand NL West-leading Arizona its fourth straight loss.

Hot-hitting Josh Satin tied it with an RBI single in the ninth off Arizona closer J.J. Putz. Cody Ross led off the 13th with a homer against David Aardsma (1-0), but the Mets fought back again against the Diamondbacks bullpen.

Satin doubled with one out off Josh Collmenter (4-1) and John Buck was intentionally walked. Mets pitcher Matt Harvey pinch hit for Aardsma and sacrificed the runners over. After Omar Quintanilla was intentionally walked, Brown lined an 0-2 pitch into left-center and was mobbed by teammates near first base.