It has also, Mr. de Blasio’s aides said, reinforced his message that he represents a stark break from Mayor Michael R. Bloomberg, a wealthy white divorced father who sent his children to private academies.

In the most powerful moment of the new ad, Mr. de Blasio’s son takes aim at Mr. Bloomberg’s reliance on police stops and searches, which have had an outsize impact on young black men. Looking into the camera, Dante de Blasio promises that his father will be the “only one who will end an era of stop-and-frisk that unfairly targets people of color.”

None of Mr. de Blasio’s rivals, Democratic or Republican, routinely campaign with children, and just a handful show up at events with spouses.

Among the Democrats, William. C. Thompson Jr., a former comptroller, has begun to distribute a campaign schedule for his wife, Elsie McCabe Thompson. Anthony D. Weiner’s wife, Huma Abedin, made a rare and unpleasant cameo on the trail when she stood by her husband during a news conference about new revelations of his online escapades, but has since become scarce. The wife of Christine C. Quinn, Kim Catullo, occasionally shows up at events but prefers to be seen, not heard.

Mr. de Blasio’s family, by contrast, is ubiquitous, joining the candidate for early-morning handshaking sessions with voters and late-night speeches at union halls. His wife has become such a fixture on the campaign trail that voters seek her out.

Outside a supermarket in Chelsea, an older woman in a wheelchair excitedly made her way over to Ms. McCray, whom she had seen on television, and said, “It’s so nice of you to be out there, meeting people.”

Ms. McCray took her hand and replied: “That’s the only way to do it. You’ve got to know what people are looking for and are concerned about.”