If the Queens Democratic establishment was badly rattled by Alexandria Ocasio-Cortez’s stunning victory against incumbent and kingmaker Joe Crowley last year, then a largely ignored civil court race this summer shook the city’s most powerful political machine to its core.

During primary elections in June, a Hispanic woman from the Bronx routed the candidate hand-picked by the Queens County Democratic Party for a seat on the county’s Civil Court — a race that had not been contested in nearly four decades.

“It was an incredible moment, and it was as important as AOC’s victory,” said a political strategist active in Queens and the Bronx. “Suddenly, people smelled blood.”

Insurgent candidate and lawyer Lumarie Maldonado Cruz, 47, beat Wyatt Gibbons, 56, with nearly 62% of the vote compared to 38% for Gibbons, a Queens attorney.

“AOC’s victory reminded me of my obligations to stand up for what is right,” Maldonado Cruz said when she entered the race earlier this year.

Still reeling from the victory of Ocasio-Cortez over Crowley, a 10-term Congressman and longtime Queens party boss who was also chair of the House Democratic Caucus, the party was again caught “asleep at the wheel” with no discernible strategy during the June primaries, said the strategist. He, like many of the political consultants and elected officials interviewed by The Post, did not want to be identified for fear of antagonizing the Queens party or AOC.

In addition to the judicial race, the party nearly lost the election for Queens district attorney. Party-backed candidate Queens Borough President Melinda Katz should have trounced little-known, late-to-the-race progressive Tiffany Caban, but instead squeaked by, after a month-long series of recounts, by 60 votes.

“They hate AOC,” said Baruch College political scientist Doug Muzzio, referring to the leaders of the Queens County Democrats. “She killed their meal ticket.”

But as they battle for relevancy against a progressive wave, the moderate Democrats in the Queens party are still mired in the past, observers say. The party is still controlled by Crowley’s old backers — “the three white men in the room” who have controlled Queens politics for more than three decades and reaped the benefits.

Michael Reich is the longtime executive director of the political party, and Frank Bolz is the law chairman. Gerard Sweeney has held his appointment as counsel to the Queens public administrator since 1992. In that capacity, he has raked in tens of millions of dollars for the law firm, administering estates of those who die without wills in Surrogate’s Court.

In March, party delegates elected a scandal-scarred lawmaker as the new kingmaker. But observers told The Post that Rep. Gregory Meeks, an 11-term Congressman from southeast Queens, is a lightweight.

“Meeks is essentially a backbencher in Congress, who lacks Crowley’s gravitas,” Muzzio told The Post. “He’s their puppet.”

The true political powerhouse in Queens is obvious.

AOC has national stature, demanding the attention of the House Speaker and the president. She has more than 5 million Twitter followers.

Meeks was long dwarfed by Crowley, a master politician who was angling to replace Nancy Pelosi as Speaker of the House. Meeks was labeled one of the most corrupt members of Congress by a watchdog group for reaching out to Venezuelan dictator Nicolas Maduro on behalf of a powerful donor, and failing to disclose a $40,000 loan from a Queens businessman who was later convicted of mortgage fraud. He has 28,000 Twitter followers.

Calls to Meeks’s office were not returned last week.

By the time Ocasio-Cortez won the election last November, the Queens Dems were still not taking her seriously, a Queens political strategist told The Post, adding that the party continued to focus on its core support, which is dominated by more conservative Democrats, including Hispanic and African-American women voters.

“Those women are fairly conservative Democrats who don’t watch CNN and they don’t care about AOC traveling all over the country,” a political analyst told The Post. “They really don’t like her, and find her rude and disrespectful.”

Ocasio-Cortez’s support in the borough stems largely from professionals who have recently moved to neighborhoods in western Queens, including Long Island City. She has not engaged with her Democratic colleagues much, making few attempts to meet local elected leaders, a Queens lawmaker told The Post.

“She doesn’t value local elected officials, and she has done almost nothing to build relationships in Queens,” said the elected official.

Although some members of the Queens County Dems once floated the idea of setting up their own opponent in a primary against Ocasio-Cortez, the idea was quickly abandoned, said a political observer who is close to the party.

“That would be political suicide at this point,” Muzzio said.

Now, the party’s leader has his own AOC-style challenger. Next year, Meeks will face insurgent Democratic candidate Shaniyat Chowdhury, 27. The former bartender and Marine who grew up in Queens, worked on Ocasio-Cortez’s campaign.

“The party in Queens has harnessed power for themselves for a generation, and they have failed to recognize and nurture young people from different backgrounds,” Chowdhury told The Post.

Chowdhury said he was inspired by AOC’s win.

“She proved that the grassroots could win, and that’s what we are doing: Appealing to the voters,” he said.

Asked if Ocasio-Cortez plans to help finance progressive Democrats in upcoming elections to further destabilize the Queens party, a spokesman for her campaign refused comment.