City Council Speaker Christine Quinn is so worried about losing the endorsement of a prominent gay-rights group that she’s stacking it with new members, a source said.

“The Stonewall Democratic Club — 100 new members came into that club for Chris Quinn,” said one member. “It would be a tremendous embarrassment if [Stonewall] didn’t endorse her.”

Quinn, the only openly gay candidate for mayor and the front-runner in the Democratic primary, just narrowly won the endorsement four years ago of Stonewall, an LGBT group.

Stonewall president Melissa Sklarz conceded that “there’s an element in the gay community that are unhappy with” Quinn.

Candidates and campaigns “stacking” political clubs with allies is a tradition that dates back to the days of Tammany Hall. Confederates join the club, vote to endorse their candidate, and then never go back.

When The Post directly asked Quinn’s campaign if it was stacking political clubs with Quinn-friendly members, spokesman Michael Morey would only say, “We’re hopeful we’ll get our share of support from political clubs in all five boroughs.”

Politicos are also battling for control of Quinn’s home club, the Chelsea Reform Democratic Club, sources say.

Opponents of Quinn began packing it to sway its endorsement to anyone but the council speaker, said Allen Roskoff, a member of CRDC and president of the rival Jim Owles Liberal Democratic Club.

“A lot of people joined [CRDC] when we heard she was packing,” Roskoff said. “She no longer represents progressive principles.”

The battle for endorsements isn’t limited to Manhattan. Quinn is also packing pals into at least one club in Brooklyn, where she is thought to be vulnerable because her prime opponents — city Public Advocate Bill de Blasio and former City Comptroller Bill Thompson — have roots there.

At least 30 new members — mostly Quinn supporters, some from Manhattan — recently joined the Independent Neighborhood Democrats, which covers Park Slope, Cobble Hill and Boerum Hill, said IND president Hal Friedman.

“New people are joining so they can sway the club’s vote — that’s packing,” Friedman said. “I’m going on what people tell me and on what I’m seeing … “It’s unusual for people from Manhattan to join a club like ours,” Friedman said.

Friedman also suspects de Blasio supporters of stacking, too. A spokesman for de Blasio said the campaign hasn’t asked people to join political clubs.

The club tries to dissuade the practice through bylaws that only allow members to vote if they’ve attended three meetings prior to the endorsement vote, but Friedman said it isn’t 100 percent effective.

One political consultant with firsthand experience of stacking clubs in Brooklyn compared it to people in high school running for class president and said it’s easier to do it in some clubs.

“Historically, IND is the easiest one to do,” he said.

Chris Owens of the Central Brooklyn Independent Democrats, which covers Park Slope, said it’s likely a mayoral candidate will try to stack his club as well, but pointed to the downside.