William C. Thompson Jr. knows not to initiate a handshake with an Orthodox Jewish woman. He sprinkles Yiddish phrases into his conversations with observant Jews. He is familiar enough with the rituals that, on a recent Friday visit to a home in Midwood, Brooklyn, he commiserated with a woman about the work involved in preparing for the Sabbath.

Mr. Thompson, an Episcopalian, is the only African-American candidate in the 2013 mayoral campaign, and he is focusing much of his effort on rallying support from blacks and Hispanics. But he is also claiming an edge among one of New York City’s fastest-growing groups: Orthodox Jews, who are up for grabs in the election and are concentrated in the very Brooklyn neighborhoods that Mr. Thompson’s father represented as a legislator and that he has frequented since he was a boy.

“I still remember his bar mitzvah,” joked Ben Barber, an observant Jew who owns a linen business in Borough Park.

The wide-open Democratic primary race promises to be a bit of a free-for-all, in which the candidates, with few ideological distinctions among them, jockey for advantage among the many neighborhoods and demographic groups that make up the electorate. Mr. Thompson’s courtship of Jewish voters is emblematic of calculations being made by all of the candidates: perhaps 600,000 New Yorkers are expected to participate in the Democratic primary, and many of those voters are expected to be black or Jewish.

For the first time in years, no major Jewish candidate is running for mayor. Mr. Thompson, a former city comptroller, Board of Education president and deputy Brooklyn borough president, is pushing for Jewish support.

Jews outside Manhattan could constitute one-sixth of primary voters, according to demographers, and of that group, maybe 30 percent are from the fast-growing Orthodox population, mostly in Brooklyn.

“I think Billy is going to surprise a lot of people in terms of his support in the Jewish community,” said William E. Rapfogel, the politically connected executive director of the Metropolitan Council on Jewish Poverty. “He’s extremely well liked by the Jewish community, and he’s built up a lot of credibility and good will over the years.”

In the 2009 mayoral race, as the Democratic nominee, Mr. Thompson held his own among Jewish voters against Michael R. Bloomberg’s $100 million third-term juggernaut. Whereas Mayor Bloomberg had trounced Fernando Ferrer in Brooklyn’s Orthodox neighborhoods in 2005 by five to one, Mr. Thompson lost by just two to one, and drew almost even in Crown Heights and Williamsburg, said John Mollenkopf, director of the Center for Urban Research at the City University of New York.

Ask Orthodox leaders about Mr. Thompson and the responses are uniformly warm. He was there as a child when his father forged alliances with religious leaders. He helped to defuse tensions after the Crown Heights riots. He fought for Orthodox Jews’ interests on education and business issues. And last month, he was the only Democratic candidate at a news conference denouncing Brooklyn College for a discussion of a movement that advocates boycotts of Israel.

That familiarity began with Mr. Thompson’s father, William C. Thompson Sr., who, as a state senator, city councilman and judge, represented an evolving swath of central Brooklyn, beginning in the 1960s.

Mr. Thompson’s father, who still practices law, routinely resorted to Yiddish phrases. Also, his father’s second wife, Sybil Hart Kooper, a state appellate judge who died in 1991, was Jewish.

“It goes back to when I was a child,” Mr. Thompson, 59, said in an interview. “I remember being in the car with him — was I 14? — and going to Crown Heights. Even to this day, people that you meet say, ‘I remember when you were a teenager.’

As an aide to Representative Fred Richmond (whose career was later derailed by corruption charges), and then the Brooklyn Borough President Howard Golden, Mr. Thompson served as an emissary to Orthodox neighborhoods.

Never were his diplomatic skills more in demand than in 1991, when Mr. Golden tracked him down on vacation in France and asked him to return immediately to pacify black and Jewish activists because, Mr. Thompson recalled, “Crown Heights was burning.”

“He was helpful as someone who represented authority yet had a common background, or a common race, who manifested a desire to keep things calm, and reason with people,” said Milton Mollen, a deputy mayor under David N. Dinkins. “Excellent temperament.”

After the Crown Heights riots, Mr. Thompson was active with the organization Blacks and Jews in Conversation, which was co-founded by his father, then an appellate judge. He also found ways, as the Board of Education president, to supply yeshivas with computers and supplies and to ease bus rules for students in religious schools, said Rabbi Jacob Goldstein, the longtime chairman of Community Board 9 in Crown Heights.

Orthodox Jews are hardly monolithic, thanks to divisions among the Satmars and differences among Russian immigrants, Bukharin Jews and others. But there could be 30,000 Orthodox voters in the Democratic primary this year, and they often vote in blocs, said Councilman David G. Greenfield, a Democrat who represents Borough Park and Midwood.

And while Mr. Greenfield has not endorsed anyone, he said he believed that voters would consider longstanding friendships and issues like child care, education and religious liberty.

In the 2001 Democratic primary for comptroller, Mr. Thompson defeated a better-financed candidate, Herbert E. Berman, a Jewish Brooklyn councilman. Mr. Berman said Mr. Thompson “very intelligently kept up his ties with the Orthodox community, and as a consequence, when I felt I should have gotten the endorsement of the Jewish press, they didn’t endorse either of us.”

Mr. Thompson said he was the first comptroller to make city investments in Israeli bonds. He also took part in a panel, at a 2007 conference of the American Israel Public Affairs Committee headlined by Vice President Dick Cheney, on financial sanctions against “Iran and other state sponsors of terror.”

Early this month, Mr. Thompson was the subject of a lengthy profile, in Hebrew, by an Orthodox magazine, Bakhila. And in December, Mr. Thompson made quite an impression by attending two Hanukkah events in Brooklyn and Manhattan, scheduled for the same hour, and drawing rousing receptions at both.

“Thompson’s reputation walked into the room before he did,” said Jonathan Greenspun, who served as Mr. Bloomberg’s unofficial liaison to the Orthodox community, and was an informal adviser during the 2009 campaign against Mr. Thompson. “Jewish leaders want you to show up, and they want to know: ‘Does this guy get me? Does he understand who I am and what my needs are?’ And a guy like Thompson — that familiarity, that credibility — is there, without question.”

Of course, all of the declared and presumed Democratic candidates are reaching out to Jewish voters. For instance, Bill de Blasio, the public advocate and a former councilman with Borough Park ties, has been attuned to issues grating on Orthodox Jews, like business fines and parking. Christine C. Quinn, the Council speaker, met recently with Orthodox women who own or manage businesses in Williamsburg. John C. Liu, the comptroller, has tirelessly attended community events.

But at a breakfast with Mr. Thompson at his house in Midwood, Chaskel Bennett, a businessman, used Yiddish to differentiate Mr. Thompson from other politicians. Mr. Thompson, he said, was a “mensch” and had never asked for a dime. Others, by contrast, were “schnorrers” — transactional officials who begged for dollars and votes but did not reciprocate when help was needed.

Mr. Thompson, nodding, noted that he went to middle school a few blocks away. “This isn’t about relationships from 5, 10 years ago,” he said. “This is my life.”

Mr. Bennett added that many voters had “buyer’s remorse” about 2009, because they believed the Bloomberg administration was too Manhattan-centric and ruthless in levying fines and fees.

“There are a lot of people in the Orthodox Jewish community who feel that maybe our relationship with Gracie Mansion, with City Hall, would be a lot better had Bill won the election,” he said. “Good friends are hard to find, and Bill Thompson is a friend.”