WASHINGTON — President Trump has accused his opponent, former Vice President Joseph R. Biden Jr., of being “against God,” “against the Bible” and “essentially against religion.”

At the Republican National Convention, Lou Holtz, the prominent former Notre Dame football coach, called Mr. Biden, who is a practicing Roman Catholic, a “Catholic in name only.”

But now, as Mr. Trump seeks to court Catholic voters with five weeks to go in the election, he and his top advisers are claiming that any discussion of Judge Amy Coney Barrett’s religious beliefs is tantamount to an anti-Catholic attack, as the president tries to rouse his voters by ginning up a culture war with what Republicans call a “woke clan” on the left.

At a Sunday night news conference at the White House, Mr. Trump accused Democrats of “playing the religious card” with Judge Barrett, his nominee to the Supreme Court, who is a mother of seven and a devout Roman Catholic.

“On the religious situation with Amy, I thought we settled this 60 years ago with the election of John F. Kennedy,” Mr. Trump said. “Seriously, they’re going after her Catholicism.” Without evidence, the president then accused Democrats of “basically fighting a major religion in our country.”

In a Trump campaign call with top Catholic allies on Sunday evening, Justin Clark, the deputy campaign manager, said that “the new radical left has embraced the hateful and destructive tendencies of the anti-Catholicism of the past.” He added that “instead of terrorist organizations like the K.K.K., we have a woke clan” launching anti-Catholic attacks. And he made clear the campaign’s message to Catholic voters in the final days of the race: “our faith as Catholics is under attack.”

So far, at least, attacks on Judge Barrett’s Catholicism are not coming from top Democrats, or the party’s nominee. What is striking is that Mr. Trump, a man who spends Sunday mornings at the golf course and is not known as a person of faith, is passing harsh judgment on some Catholics (like Mr. Biden) while in the next breath saying that such harsh judgments are wrong (at least when it comes to Judge Barrett).

In an interview, Gov. Phil Murphy, Democrat of New Jersey, called Mr. Trump’s tactic “the faith version of the Merrick Garland hypocrisy” — in other words, an example of the president doing to his political opponent exactly what he claims is unacceptable if it is done to him, or anyone he views as politically helpful to him. He was referring to President Barack Obama’s last Supreme Court nominee, whom Senate Republicans refused to consider because, they said, it was a presidential election year.

Mr. Murphy, a Catholic, said the weight of the debate about Judge Barrett’s confirmation “should be on her positions on health care, choice and environmental protections,” and not focused on her faith. But he added, “You can’t have it both ways. You can’t corner the guy and question his faith and then say on the other side of your mouth that someone’s faith is off limits.”

Past comments about Judge Barrett’s faith from some Democrats — most infamously during her 2017 Court of Appeals confirmation hearing when Senator Dianne Feinstein claimed that “the dogma lives loudly within you” — have offered grist for Republicans trying to link anti-Catholic bias to the Democratic Party.

But Democratic leaders and Mr. Biden’s campaign, all of whom oppose Judge Barrett’s confirmation, have treated Ms. Feinstein’s comment as a flashing warning sign. In fact, they are being cautious to avoid coming near any discussion of her religion. Supporters of Mr. Biden said that avoiding personal questions about Judge Barrett’s faith in the coming weeks is critical, politically, when Mr. Biden has an opportunity to make inroads with some religious voters who tend to support Republican presidential nominees.

Some conservatives even said that the Trump campaign’s accusations against Mr. Biden were similar to the false Republican claims tying him to fringe groups of violent protesters.

“Is it beyond them to try and make more out of the criticism than exists? No,” said Peter Wehner, a senior fellow at the Ethics and Public Policy Center, a conservative think tank. “They create stories out of nothing.”

ImageJoesph R. Biden Jr. and two of his grandchildren depart St. Joseph on the Brandywine Roman Catholic Church after attending a Sunday service in Wilmington, Del.
Credit…Amr Alfiky/The New York Times

Catholic voters, a diverse group that includes some of the last remaining swing voters in the country, are being targeted by both campaigns — particularly white Catholic voters in the industrial Midwest. Mr. Biden, who regularly makes references to God and his faith, and sprinkles biblical references into his speeches, is more appealing to those voters than Hillary Clinton was four years ago, polls indicate. Recent polls show Mr. Trump’s advantage with white Catholics slipping compared to where it was in 2016, when they favored him by about two to one.

But the notion that Catholics are under attack could resonate with some of those voters. The president’s politics of white grievance appear to have a receptive audience with many of these voters: Fifty-one percent of white Catholics agreed with the idea that discrimination against white people was as much of a problem today as discrimination against racial minorities, according to a Public Religion Research Institute poll in June.

While no prominent Democratic senators have raised questions about Judge Barrett’s faith since Mr. Trump announced his pick to replace Justice Ruth Bader Ginsburg, that hasn’t stopped the president or his campaign from acting as if they did. They have seized on a handful of comments from left-leaning talking heads, comedians and former lawmakers to turn the confirmation hearings into the latest culture clash — with the goal of reducing Mr. Biden’s margins among Catholic voters.

The campaign pointed to comments from the comedian Bill Maher, who noted on his show that Judge Barrett was “Catholic. Really Catholic. I mean, really, really Catholic — like speaking in tongues.” And they flagged tweets from the MSNBC host Joy Reid and former Representative Katie Hill, comparing Judge Barrett’s religion to something “that is straight out of ‘The Handmaid’s Tale.’”

“The question is: Where is Joe Biden in this?” said Tim Murtaugh, the Trump campaign spokesman. “Why doesn’t he condemn anti-Catholic bigotry from his party?”

But some conservatives said it was a stretch to connect those comments to Democratic leaders, or to the party’s nominee.

“There is a strand within the Democratic Party which is secular and hostile to faith,” said Mr. Wehner. “That’s different from the political leadership having that position, or Joe Biden holding that position. But the Trump campaign will try and make enemies out of anyone, whether they are real or not.”

John Carr, the former top official at the U.S. Conference of Catholic Bishops, said it was “an almost impossible job to convince a reasonable person that Joe Biden is anti-Catholic.”

Mr. Carr, who has endorsed Mr. Biden, added that “if the Democratic Party were to demonstrate hostility to faith, family or unborn children, they’d be in trouble with a lot of Catholics. But the Biden campaign isn’t doing that. The one thing that could do damage is if people allied with Biden go down that road.”

Trump allies said it made little difference that Democratic leaders were not engaging in attacks involving a person’s faith.

“How thrilling that Democrats have had to come out and say we’re going to leave religious bigotry on the shelf for a little while,” said Tim Phillips, the president of Americans for Prosperity, a conservative group. “It tells you about where you are when they have to say that. The Feinstein comment will live in infamy.”

Mr. Phillips blamed Senate Democrats for not doing more to condemn others’ attacks on Judge Barrett’s faith and family. But he also declined to comment about Mr. Trump’s denunciation of Mr. Biden’s religion.

Giovanni Russonello contributed reporting from New York.