A Republican mayoral hopeful who’s challenging New York City’s Democratic incumbent Bill de Blasio released an ad ridiculing the mayor’s penchant for hitting the gym during the workday.

The ad, for candidate Paul Massey, riffs off de Blasio’s Dickensian slogan of his winning 2013 campaign: that modern-day New York represents a tale of two cities, a gulf between rich and poor.

Massey is shown with gloves and a punching bag, while de Blasio wears a Brooklyn hoodie, his face cast downward in an unflattering frame.

“This race is ‘A Tale of Two Workouts,’” the ad says, quoting the TV news station NY1.

Massey, a real estate executive pitched as being in the mold of former mayor Mike Bloomberg, outpaced de Blasio in a recent fundraising report, but the mayor had more in his war chest.

For years, de Blasio has been ridiculed for going to the gym at a YMCA in his old neighborhood of Park Slope, Brooklyn in the late mornings from the mayoral residence Gracie Mansion on Manhattan’s Upper East Side.

advertisement | advertise on newsday

Asked how much the ad cost, how often it’s running and who created it, Mollie Fullington of the Massey campaign described the ad as “a creative, data-driven digital campaign.”

“We are just getting started. This is one of many ads we will be running to highlight the contrasts between Paul Massey, a hardworking small-business man who built a successful business in the five boroughs of New York City, and Bill de Blasio, the corrupt, divisive, part-time mayor,” she said.

De Blasio campaign spokesman Dan Levitan said in an email Wednesday night: “Crime is at record lows, jobs are at record highs and the City is building affordable housing at a record pace. Mayor de Blasio is fighting for New Yorkers by raising wages for tens of thousands of workers and expanding Pre-K and afterschool programs for tens of thousands of kids. We are happy to compare that record of success against anyone.”

Separately Wednesday, de Blasio received an endorsement by the United Federation of Teachers union.