TORONTO — The music — “2 Dollar Bill,” by 2 Chainz — sounded louder than usual, as did high-energy reliever Tommy Kahnle, while the Yankees dressed and packed their belongings in the snug Rogers Centre visitors’ clubhouse.

All wins produce a soundtrack, as per the mandate of DJ Aaron Judge. This one, however, a 1-0 blanking of the Blue Jays to stop a two-game losing streak, created more energy, more excitement than usual. And for all that Masahiro Tanaka did to make this result possible, it’s what he couldn’t quite do, ultimately, that led to the party-type atmosphere.

The Yankees posted a 5-2 record on their tour of the American League East’s dregs because they survived an epic, 13-pitch, ninth-inning battle between their All-Star closer Aroldis Chapman and the Blue Jays’ future Hall of Famer Vladimir Guerrero Jr. and lived to tell the tale.

“I think there was probably a little more energy than normal based on how that inning unfolded,” Aaron Boone acknowledged. “So it was a good way to finish off a trip after a couple of losses.”

“Any time you’re able to get a guy out, get a double play when you need it, it’s going to feel great,” Chapman said through an interpreter.

They return home for four games against the dreadful Orioles, the team they swept in Baltimore on the first leg of this trip, and their pitching staff looks to be in reasonably good shape for Monday’s day-night doubleheader, thanks to Tanaka’s brilliant eight-plus innings in which he permitted only three hits while walking none and striking out four.

Let’s talk about that “plus” in the “eight-plus” innings. With only 91 pitches on Tanaka’s ledger, Boone afforded his right-hander the chance to record a complete-game shutout, only to yank him when former Yankee Brandon Drury led off with a ground-ball single to left field.

In came Chapman, who hadn’t pitched since Monday, put in the atypical spot of having to put out a fire with the tying run on first.

“[I] threw him in in about as tough a spot as you can, giving him a base runner to start and no margin for error, really,” Boone said.

Blue Jays manager Charlie Montoyo responded by pinch-hitting Guererro for catcher Reese McGuire.

Chapman hadn’t yet faced Guerrero, who made his major league debut earlier this season (and who, OK, isn’t a guaranteed Hall of Famer quite yet). On June 26, 2011, Chapman, while with the Reds, struck out Junior’s dad, Vladimir Guerrero, then with the Orioles, amid the actual Hall of Famer’s final season.

“In a very well-played, 1-0 game, you’ve got a young rising, great-looking hitter against the game’s dominant closer,” said Boone, speaking like the broadcaster he once was. “It was a great kind of match to watch those two guys go at it.”

Guerrero swung through the first two pitches, both fastballs, putting him in a quick hole.

“That was the strategy early in the at-bat, go up and in,” Chapman said.

A foul on a sinker slightly out of the strike zone followed, and then came ball one, low. Guerrero fouled off five pitches, took ball two, fouled off two more, took ball three and fouled again. That gave the duel 13 pitches, eight of them fastballs — three of those 100 miles per hour or faster — and four sliders.

Asked what he was thinking as he worked with Chapman from behind the plate, Austin Romine said, “Man, this is a good at-bat. I mean, to come off the bench like that, and to hit off Chappy throwing 100 [mph], and to foul off some really good sliders down and in. … But Chappy made a really good pitch, the last one. Two-seam down.”

“I tried to pitch him up and out and eventually just ended getting him out with low and inside,” Chapman said. Guerrero Jr. hit it right at shortstop Gleyber Torres, who started the 6-4-3 twin-killing — and the crowd saluted its stud rookie with a standing ovation, despite the bad outcome. After Bo Bichette, another legacy, singled, the Jays’ third such son of a major leaguer, Cavan Biggio, whiffed on a Chapman slider to get the Yankees’ party started.

The Yankees’ bats largely took the weekend off, and Judge in particular still looks nowhere close to right. Those concerns were alleviated temporarily, though, thanks to an old-fashioned showdown. No matter how much the game evolves, prevailing in a battle like that still makes you feel pretty great.