Making the media rounds for his new comedy “Balls Up,” Mark Wahlberg stopped by “Jimmy Kimmel Live!” on Monday night to chat about the film, as well as his deep Boston roots.

The late-night host took the former Funky Bunch star on a trip down memory lane, sharing a photo of a 20-year-old Wahlberg with his older brother Donnie and “The Fresh Prince of Bel-Air” actor Will Smith from a 1991 “MTV Rock N’ Jock” appearance. Kimmel proceeded to play a video from the basketball game, with Wahlberg noting that he won the event’s dunk contest. However, the Dorchester native seemed to cringe a bit hearing his “very thick” Boston accent from back in the day.

“Nothing worse than hearing that accent,” Wahlberg told Kimmel. “I spent a good long time trying to get rid of the Boston accent, only to then go and do movies like ‘The Fighter,’ ‘[The] Perfect Storm,’ ‘The Departed,’ all these movies.”

The actor revealed that he commiserated with his fellow Bostonian and “The Departed” costar Matt Damon about how their accents would be perceived by fans, since they were the only Bay State stars in the film.

“He and I were the only ones actually from Boston, but we were kind of looking at each other like, ‘I think people are going to think that we have the fake Boston accents,’ and we’re going to stick out like a sore thumb,” said Wahlberg.

Later in the interview, Kimmel put Wahlberg’s Boston bona fides to the test in a skit called “Wheah ya frahm?” that involved the star picking Bostonians out of a lineup on the street, but without getting to hear them speak (since the Boston accent is pretty noticeable).

“I think there’s a good chance,” Wahlberg said before kicking off the bit. “Now there are very, very different and specific types. There’s quite a few different types of Boston folks.”

In the first group of pedestrians, Wahlberg asked if any of them had ever gotten drunk on a duck boat, with a man wearing a green jacket named Dave the only one to nod yes to the question.

“I told ya, he’s from Gloucester,” joked Wahlberg, who correctly identified that the man was from Massachusetts (the contestant revealed that he “used to take the commuter rail from Foxborough”). For his efforts, Dave received three bags of clams as his prize.

In the next group, the Bostonian was pretty obvious, as a man named PJ wore a Dunkin’ outfit and was the only one who picked white clam chowder over the red version when Wahlberg asked which type was better. PJ turned out to hail from East Boston, and received Wahlburgers coupons as his reward.

The final group was a bit more challenging, as a woman named Taylor and a man named Scott both gave very Boston answers to questions like “If someone yells, ‘Go Yankees,’ what hand gesture would you make?” (Taylor and Scott both flipped the bird), and picked Larry Bird over Michael Jordan in another query from Wahlberg.

For his final question, Wahlberg asked if any of them had ever gotten into a first fight with a relative. Again, Taylor and Scott gave the same answer, nodding yes, but Wahlberg ultimately made the correct choice, selecting Taylor as the Bay Stater in the lineup (she revealed that she’s from Beverly), with the show giving her a Red Sox cap filled with baked beans as the final prize.

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