Donnie Wahlberg danced his way onto Wednesday’s episode of “The Tonight Show Starring Jimmy Fallon,” moving and grooving with the late-night host as The Roots introduced the Boston star by playing the New Kids on the Block hit “You Got It (The Right Stuff).”

Dubbing Fallon “the sixth New Kid” for his fancy footwork, Wahlberg admitted that, as he’s gotten older, he’s enjoyed hearing the song more, although that wasn’t always the case.

“When I was younger, I’d go to a Celtics game or something, and they’d start playing [it] and I’d be like, ‘I just want to watch the game,’” Wahlberg admitted to Fallon, noting how fans back then would sometimes scream “Donnie, you’re a losah” at him during games. However, he gets more cheers than jeers these days, and has changed his tune on the song. “As I get older, I really embrace it. I really love it.”

Fallon and Wahlberg proceeded to have a wide-ranging chat, covering everything from their time together on the set of the Emmy-winning series “Band of Brothers” to looking back at NKOTB’s debut album, which celebrated its 40th anniversary this month. Turning the conversation to Wahlberg’s latest project, the “Blue Bloods” spinoff series “Boston Blue,” Fallon joked that the actor and singer, who’s “famously” from the Hub, fueled up for the late-night appearance in the most Boston way possible.

“As I went to say hi to you before the show, in your dressing room, you were drinking a Dunkin’,” Fallon said, with Wahlberg noting that he had some sweet treats too. “We had, actually, Dunkin’ doughnuts.”

While “Boston Blue” is set in the Bay State, Wahlberg’s character on the show is from the Big Apple, with the New Kid explaining that it can get complicated since he’s “a Bostonian playing a New Yorker moving to Boston.”

“If you don’t win the Emmy, I don’t know what we’re doing wrong, buddy,” Fallon joked, with Wahlberg quipping, “I’ll settle for a Blockbuster Video Award at this point.”

Admitting that his Boston accent will slip out occasionally during production, Wahlberg also revealed that filming in the Hub for the series would sometimes get chaotic, as locals would often call out to him in the middle of scenes. “I can’t say no to anyone in Boston,” said Wahlberg.

The “Boston Blue” actor went on to explain how Celtics star Jaylen Brown ended up on the show earlier this year, revealing that he’s friends with the NBA champion. According to Wahlberg, Brown asked about doing a cameo and got to film his part during an off-day following a game in Toronto (Wahlberg noted that “Boston Blue” mostly films in Toronto).

“The scene was him ridiculing me ‘cause [my character is] a Knicks fan,” Wahlberg said. “I’m the biggest Celtics fan. But I had to do it.”

As for other Boston celebrities he’d like to see on the show, Wahlberg mentioned his famous younger brother, but didn’t sound confident on booking him.

“I’d like to get some other Boston guys in it,” Wahlberg said. “Mark Wahlberg maybe. I don’t know. He don’t want to act with me.”

The New Kids on the Block member went on to joke that his brother could play an “old retired Marky Mark” who’s “selling hot dogs at the Celtics game,” while Fallon thought he’d make for a good priest on the show as “Father Marky Mark.”

While Ben Affleck and Matt Damon were also thrown out there as cameo contenders, Wahlberg mentioned that Fallon would make for a great guest star too.

“You’re not a Bostonian, but you do a good accent,” Wahlberg told the “Fever Pitch” star. “You would be a great guest.”

Fallon said he’d love to appear on the show, with the stars proceeding to do a little acting roleplay.

“I would say, ‘Hey, drop the Dunkin’s coffee’ in my New York accent,” Wahlberg joked, with Fallon responding, “I would fake do a Boston accent, ‘I’m sorry, officah.”

Matt Juul can be reached at matthew.juul@globe.com.