A rival of Melissa Mark-Viverito filed a million-dollar lawsuit against the front-runner for City Council speaker — claiming she put a Caribbean hex on her while the two were running for the same council seat, in the form of a black-magic mural on her building.

Gwen Goodwin, 52, who spectacularly lost the Democratic primary to Mark-Viverito in September, says her nemesis targeted her East 100th Street building as the canvas for a five-story image of a bodiless rooster atop wooden poles.

The head is just below the window of the apartment where Goodwin has lived since 1997.

Mark-Viverito is expect­ed to be voted in as the next City Council speaker on Thursday.

“According to neighbors of Puerto Rican and other backgrounds, in the Caribbean culture, this constituted a curse and a death threat, as a swastika or a noose would symbolize typically to many Jews or African-Americans,” Good­win alleges in a Manhattan Supreme Court suit she filed Friday.

Many New York Puerto Ricans practice a hybrid religion called Santeria, which is based on Catholicism but includes voodoo-like ceremonies and animal sacrifices. East Harlem even boasts a specialty shop dedicated to the religion called Justo Botanica, at East 104th Street and Lexington Avenue.

Mark-Viverito was the head of an urban-art campaign launched last summer called Los Muros Hablan (“the walls speak”). The effort celebrates Latino culture by painting murals on walls across the five boroughs.

She partnered with Goodwin’s landlord, Eastside Managers Associates, for the East Harlem project, which was dedicated on Sept. 1.

But Goodwin claims her rival’s motives were pure evil.

“This is supposed to be a professional politician who came and graffitied the side of my building,” Goodwin told The Post.

“I really felt that people needed to understand who they were giving power to as the next most powerful person behind the mayor of New York City,” she said.

Mark-Viverito has also faced criticism for taking taxpayer subsidies meant for low- and moderate-income New Yorkers for an interest-free mortgage, even though her net worth is estimated at more than $1.5 million.

Goodwin said she endured “emotional distress” from the alleged spell that distracted her from running a winning campaign.

“This intimated me and caused me fear. I’m a Christian. I don’t believe outside my religion, but strange things were happening,” Goodwin claimed.

She said that she suddenly got a blood clot in her foot and that a close friend began “acting crazy” right after the mural went up.

The landlord did not return calls for comment.

Eric Koch, a spokesman for the councilwoman, blasted the suit.

“These desperate and ­ridiculous allegations by a failed political opponent of Melissa are false, absurd and a waste of the court’s precious time. It’s sad but expected that Melissa’s ­opponents are resorting to these kinds of tactics,” Koch said.