Months before the massacre in Newtown, Conn., put the National Rifle Association on the defensive, the powerful gun rights group faced an unexpected problem. One of its most loyal Democratic friends in Congress was leading a rebellion against an NRA effort to hold Attorney General Eric H. Holder Jr. in contempt of Congress, a cause viewed by Democrats as a political sideshow that had nothing to do with gun rights.

“This, my friends, is not a position I relish,” Rep. John D. Dingell (Mich.) wrote in an anguished letter urging fellow gun lovers to reject the NRA’s position.

Dingell’s rare show of defiance was seen by his colleagues as part of a growing estrangement between the NRA and its Democratic allies, who have provided vital support in the past and could be important again next year in what appears to be a coming showdown over gun rights. With public pressure building on Congress to act, the NRA will need Democratic votes to block or weaken legislation, particularly in the Senate.

While the NRA devoted most of its national campaign efforts this year to supporting Republicans and opposing President Obama, the group has historically gained its clout in Washington by nurturing close ties to lawmakers in both parties, particularly those from rural areas who have counted on the NRA’s blessing to get elected.

But several recent factors have altered that calculus. And, with the horror of the Newtown school shootings forcing gun control back onto the national agenda, a decline in the NRA’s traditional bipartisan strength provides gun-control advocates with what they see as their best prospects in nearly two decades.

Look at gun homicides and gun ownership by country

For one, many rural Democrats lost their seats in the past two congressional elections. Political battlegrounds have also shifted away from those rural areas to the suburbs, where the NRA holds less sway and there is more appetite for restrictions on guns. And Democrats are looking increasingly at the NRA as an arm of the Republican Party, pointing specifically to the Holder contempt vote this year and the group’s 2009 opposition to Supreme Court nominee Sonia Sotomayor as key turning points.

“I worry the NRA has become a captive of the Republican Party at a time that it needs Democratic votes,” said Rep. Gene Green (D-Tex.), who has had a top rating from the NRA but joined Dingell in opposing the censure of Holder. “In the long run it will be weakened.”

Aside from the group’s problem with Democrats, it faces a threat to its immense money advantage from billionaire New York City Mayor Michael R. Bloomberg (I), who has started to back candidates who are taking on NRA allies.

Nevertheless, the NRA remains one of Washington’s most feared lobbies, with an annual budget of more than $200 million and the ability to reach millions of people through mail, magazines, broadcasts and a Web-based alert system. Its extensive political scorecards are closely watched by state and federal candidates, who frequently boast in their campaigns if they earn an “A” rating with the group. Democrats, in a strategy designed by then-Rep. Rahm Emanuel (Ill.), retook the House in 2006 in part by recruiting pro-gun centrists to run in conservative districts.

The Fairfax County-based organization, founded in the 19th century to promote marksmanship, expanded after the assassinations of the 1960s and now claims 4 million members. It is the face of the gun rights movement, pushing its agenda in courts, city council chambers and state capitals in addition to Congress.

It has an iconic image, tapping movie star Charlton Heston as its leader in the late 1990s, and has had an eclectic roster on its board, including actor Tom Sel­leck, basketball star Karl Malone and anti-tax activist Grover Norquist. The most prominent NRA spokesman now is its executive vice president, Wayne La­Pierre, who warned a conservative audience this year that if Obama won reelection, “America as we know it will be on its way to being lost forever.” He also described the president’s lack of action on gun control in his first term as a “massive Obama conspiracy to deceive voters and hide his true intentions to destroy the Second Amendment during his second term.”

The NRA’s continued clout could be seen Wednesday, when one of its Democratic friends, Sen. Joe Manchin of West Virginia, toned down comments he made earlier in the week expressing openness to a new assault-weapons ban. Citing a statement Tuesday by the NRA on the Newtown shootings in which the group said it was “prepared to offer meaningful contributions” to the debate, Manchin told a West Virginia radio host that he was “so proud of the NRA and so pleased that they have agreed to be a part of this.” He said: “I’m not supporting a ban on anything. I’m supporting a conversation on everything.”

NRA officials declined to comment for this article and have remained out of public view since Friday. The Tuesday statement said the group was “shocked, saddened and heartbroken by the news of the horrific and senseless murders in Newtown.” NRA officials have a news conference planned for Friday.

The growing partisan divide was evident this week when House Democrats announced a strategy to reach beyond the NRA’s Washington leadership to appeal to its members, who polls suggest support some restrictions.

“There will be a growing wedge between the extreme positions and tactics of the Washington-based lobbyists for the NRA and its grass-roots membership,” Rep. Chris Van Hollen (Md.) said in an interview after a meeting with his fellow Democrats.

Obama hinted at a news conference Wednesday that he would follow a similar playbook, describing the NRA as “an organization that has members who are mothers and fathers,” who would welcome some restrictions.

House Democrats, wary of being portrayed as urban elites who want to strip Americans of their gun rights, looked to one of their few remaining members with some bona fides to lead the effort, tapping Rep. Mike Thompson (Calif.), a hunter and wounded Vietnam War veteran.

Thompson said he has requested a meeting with NRA leaders and has been hearing from avid hunters and some Republicans back home, telling him, “We do not need these assault weapons. What can I do to help you?”

The California Democrat is emblematic of the growing divide between his party and the NRA. His district is becoming more suburban and less rural, and it happens to be in Napa Valley, the heart of California’s wine country — hardly representative of Middle America.

As recently as 2010, the NRA and Democrats teamed up to score a major victory. The group and its Blue Dog allies pressured House leaders to carve out a special exemption for the gun group in the Disclose Act, which would have required every corporation and nonprofit group to reveal top donors to broadcast political ad campaigns. As amended, the legislation exempted 501(c)4 organizations with more than 500,000 members. Legislative staffers said the narrow language, requested by the NRA, would apply to only the gun organization and a tiny handful of others.

Democratic leaders initially balked at the exemption but relented after meetings in which the NRA’s chief lobbyist, Chris Cox — joined by Dingell and Rep. Heath Shuler (D-N.C.) — warned that without it, the legislation would lose 50 Democratic votes, according to a person familiar with the meetings who spoke on the condition of anonymity because of the sensitivity of the discussions.

By the time the session was over, Van Hollen, the bill’s author, “looked as though he was going to vomit,” according to the person familiar with the meetings. The measure passed on a mostly party-line vote in the House but died in the Senate.

This July, as House Republicans moved to censure Holder for his role in withholding information on a botched gunrunning investigation known as Operation Fast and Furious, some Democratic allies were angered at being told that their NRA election grade would be based in part on the Holder vote.

“I find myself in an unusual position today,” Dingell wrote in his June 28 letter to colleagues. “It seems I am at odds with the National Rifle Association, a group with which I have been proud to be associated with throughout my tenure in Congress.”

Dingell’s actions helped persuade numerous pro-gun-rights Democrats to join him in opposing the Holder resolution. Of the 31 Democrats who signed on to a June letter to Obama expressing “serious concern” about the administration’s response to the congressional inquiry into Fast and Furious, 11 opposed the Holder resolution and four did not vote.

Demographic changes in some districts have given Democratic lawmakers more latitude to buck the NRA.

Rep. Jim Cooper (D-Tenn.), for instance, has for years been viewed as an NRA friend. But that is largely a vestige of his time in the 1980s and 1990s representing a rural district. His district is now based in and around Nashville. Cooper opposed the Holder censure and said this week that he was “willing to consider any proposal that will keep our children safe, regardless of politics.”

A similar shift can be seen in Sen. Mark R. Warner (D-Va.), a supporter of gun rights who has criticized the NRA in recent years, perhaps feeling freer as the political power of Virginia has shifted to the more centrist suburbs and exurbs. He blasted the NRA in 2009 for its opposition to Sotomayor and made headlines this week when he told reporters that he had received “A” ratings from the NRA in the past, but “enough is enough.”

Money is also a factor. The NRA has historically outspent gun-control advocates in elections, but Bloomberg poured more than $9 million late in this year’s campaign to defeat opponents of gun restrictions.

During the 2012 cycle, the NRA spent about $20 million on federal races, according to the Center for Responsive Politics, mostly in support of Republican lawmakers.

Rep. Joe Baca (D-Calif.), a longtime gun rights proponent, lost this year after being targeted by Bloomberg. He blames the NRA for failing to bolster his campaign, citing his refusal to support the Holder resolution.

The NRA “left me high and dry, despite my years of strong support for Second Amendment rights,” Baca said in an interview.

Sari Horwitz contributed to this report.