TORONTO — The Yankees used Sunday’s game against the Blue Jays as a window to view what Jordan Montgomery and Dellin Betances could do in their first big-league games of the season.

Montgomery looked rusty, but Betances, who worked without his signature nuclear fastball but with a sharp breaking ball, struck out the two batters he faced looking.

Experimenting with Montgomery and Betances didn’t mean the Yankees weren’t trying to win because Gio Urshela was the only regular who sat to start the games.

But the three runs Montgomery gave up paired with the three Nestor Cortes Jr. surrendered were enough to get the Yankees beat, 6-4, in front of 22,562 Rogers Centre customers, whose interest level was low.

The loss ended a 10-game Yankees road trip, which opened in Boston, moved to Detroit and finished in Canada, with a 6-4 record and left the Yankees’ magic number to clinch the AL East title stalled at four pending the outcome of the Rays-Angels game in Anaheim, Calif., later Sunday.

While the race for the AL East is all but over, the Yankees didn’t help themselves in the chase for home-field advantage throughout the postseason by dropping two of three to the rebuilding and pitching-poor Blue Jays.

After scoring a run in the first on Aaron Judge’s opposite-field homer to right and twice in the third when DJ LeMahieu and Didi Gregorius drove in runs, the Yankees didn’t score again until the seventh.

That’s when Blue Jays third baseman Richard Urena’s throwing error on LeMahieu’s ground ball allowed Austin Romine to score from second and cut the deficit to 6-4.

Montgomery’s first big-league game since last May 1 due to Tommy John surgery resulted in the left-hander giving up two runs and three straight hits in the second and a solo homer to Randal Grichuk in the third, when the Blue Jays tied the score, 3-3. Montgomery threw 41 pitches.

Grichuk added a three-run homer off Cortes in the fifth.

Between Montgomery’s two frames the Yankees jumped ahead, 3-2, in the third when LeMahieu doubled in Tyler Wade and Gregorius plated LeMahieu with a single.

Judge’s one-out homer to right field in the first staked Chad Green to a 1-0 lead that the right-hander protected by pitching around Bo Bichette’s leadoff double in the home half of the inning.