The Yankees got their up-close look at potential trade target Marcus Stroman on Sunday and — more importantly — another victory.

Gio Urshela had a two-run single in the second and scored the go-ahead run in the fifth with the help of a nifty slide — and a bad tag — as the Yankees topped the Blue Jays, 4-2, in The Bronx.

The win allowed the Yankees to maintain their six-game lead in the AL East over the Rays, who come to Yankee Stadium for a four-game series beginning Monday.

But what impressed Aaron Boone most after his team won another series was its starting pitching.

“I feel like it’s been underrated all year and underappreciated because by and large, you’re not sitting at this point in the season with as many wins as we have if you’re not getting quality starts,’’ Boone said after Masahiro Tanaka allowed two runs over six innings and the Yankees improved to an AL-best 59-32.

The Yankees’ rotation has a 2.67 ERA in nine games since returning from London, where there was a barrage of runs in two wins over the Red Sox.

“It hasn’t always necessarily been deep into games, but for the most part, our starting pitchers have given us a chance to win every single day,’’ Boone said. “I feel like sometimes that gets glossed over a little bit. Those guys are very capable and right now they’re healthy and throwing the ball really well.”

After dropping three of their previous four games sandwiched around the All-Star break, the Yankees made three errors, but still beat Stroman, who will almost certainly be traded before the July 31 deadline.

In his first outing since leaving his June 29 start with a left shoulder pectoral cramp, Stroman gave up three runs in six innings, though was hardly hit hard.

Urshela singled in two runs with a one-out single in the second to give the Yankees a 2-0 lead before Tanaka pitched out of trouble in the third. Gleyber Torres made his second error of the day in the third, but rebounded with a diving play to end the top of the sixth.

Tanaka made the first of two mistakes with his fastball when Randal Grichuk opened the fifth with a long homer to right-center to make it 2-1.

Tanaka had allowed just a pair of singles entering the inning, but Toronto tied the game later in the fifth, when Eric Sogard took Tanaka deep with two outs.

Urshela put the Yankees ahead again in the bottom of the frame.

With one out and runners on first and second, DJ LeMahieu grounded into a force out, but a poor throw to second by Sogard slowed the turn and allowed LeMahieu to beat the double play.

With Aaron Judge at the plate, Stroman fired a wild pitch that went to the backstop and bounced right back to catcher Danny Jansen.

Urshela looked to be out easily at the plate, but the Yankees challenged the call and replays showed Urshela slid under a woeful tag attempt by Jansen to put the Yankees up, 3-2.

“That’s the ball game right there,’’ Judge said. “Especially against a pitcher like Stroman. … [Urshela] took a chance and it paid off.”

Adam Ottavino came on to start the seventh and gave up a one-out hit to Jansen. With Rowdy Tellez pinch hitting for Teoscar Hernandez, the Yankees stalled before bringing in Tommy Kahnle to face the lefty-swinging Tellez — despite Ottavino having thrown just five pitches.

Kahnle, excellent against left-handers, whiffed Tellez. The right-hander then walked Sogard, but got Freddy Galvis to end the inning.

Mike Tauchman gave the Yankees an insurance run with a solo homer in the seventh — their first in three games.

Zack Britton pitched a scoreless eighth and Aroldis Chapman closed it for his 25th save of the year.

The Yankees will almost certainly pick up a starting pitcher before the end of the month, but Toronto manager Charlie Montoyo left the series with a mindset similar to Boone’s.

“I tell you what, the pitching we faced these three days, it’s pretty good,’’ Montoyo said. “I don’t know what to tell you about what they’re thinking, but what we saw these three days is good pitching.’’