NEW YORK -- Masahiro Tanaka pitched like the ace the Yankees needed him to be, allowing four hits over seven innings to lead New York over the Toronto Blue Jays 5-0 Sunday and stop his team's five-game losing streak.

Dustin Ackley homered and had three RBIs for the Yankees, who closed back within 3 1/2 games of the AL East-leading Blue Jays with 20 games left.

Toronto had won the first three games of the four-game series, but the Yankees sent R.A. Dickey (10-11) to his first loss since before the All-Star break. The Blue Jays and Yankees play three more times in Toronto from Sept. 21-23.

The Blue Jays said before the game that All-Star shortstop Troy Tulowitzki will miss at least two weeks after cracking his left shoulder blade in a collision during the opener of Saturday's doubleheader. Edwin Encarnacion was held out after aggravating a finger injury Saturday.

Tanaka (12-6) struck out seven, walked none and threw 76 of 108 pitches for strikes. He is 3-0 with a 2.54 ERA in his last four starts.

On Aug. 15, he beat the Blue Jays with a five-hitter in Toronto.

Dickey (10-11) gave up five runs and seven hits in 7 2-3 innings. The knuckleballer had been 7-0 with a 2.68 ERA in 11 starts since losing at the Chicago White Sox on July 9.

Ackley, starting because he was 4 for 11 against Dickey coming in, homered for the first time since July 8 for Seattle against Detroit.

New York went ahead in the second on sacrifice flies by Ackley and Didi Gregorius. Ackley, acquired from the Mariners on July 30, hit a two-run homer in the fourth, and Alex Rodriguez added an RBI double in the eighth that chased Dickey.

Rodriguez was honoured by the Yankees before the game for his 3,000th hit on June 19, another step of the thawing of the formerly tense relationship between A-Rod and team stemming from his one-year drug suspension and litigation when he tried to avoid discipline.

MAKING MOVES

Toronto acquired infielder Darwin Barney from the Los Angeles Dodgers for minor league catcher Jack Murphy.

TRAINER'S ROOM

Blue Jays: General manager Alex Anthopoulos said second baseman Devon Travis (shoulder) has yet to take swings or play any games and they are "running out of time" for the rookie to return .

UP NEXT:

Blue Jays: After an off day, the Blue Jays open a series at Atlanta on Tuesday with Mark Buehrle (14-7) starting, opposed by Julio Teheran (10-7, 4.38).

Yankees: CC Sabathia starts Monday in the opener of a three-game series at Tampa Bay, which starts Erasmo Ramirez (10-5).