Mayor Bloomberg is willing to spend some of his vast fortune to fight the re-election bids of City Council members who vote to override his veto of a bill that curtails stop-and-frisk, The Post has learned.

“The mayor believes actions have consequences, and [he] certainly hasn’t ruled out holding members accountable for their votes,” said one source close to the mayor.

On Thursday, the council approved a bill that enables lawsuits against the NYPD for anyone who believes cops used bias-based profiling in conducting a stop-and-frisk.

It passed, 34-17 — exactly enough votes to override Bloomberg’s expected veto. That means the mayor needs only one member to switch positions in order to kill the bill.

With every seat in the council up for grabs this year, Bloomberg’s PAC will “cast a wide net” and try to persuade council members to flip their votes, said Deputy Mayor Howard Wolfson.

“I’ve got the time to talk to all members. Basically, we’re going to recanvass as many members as we can and see what we come up with,” Wolfson said.

One member who might be approached is Erik Dilan (D-Brooklyn), who plans to run in a tough congressional race against Nydia Velazquez next year, sources said.

But despite consistent attempts from Bloomberg and his aides to persuade him to vote against the bill, Dilan said he is unlikely to ditch his support of the measure unless they make a stronger case.

“It would have to be incredibly compelling, and it would have to be factual,” Dilan said. “It can’t be more of the same. Once you go on the record as having voted for something the first time around, it’s hard to change your vote without a substantial revelation of fact.”

When asked about spending against council members yesterday, the mayor offered a tongue-in-cheek response and did not deny his plans.

“I think you should urge your readers to vote for those people that want to keep this city safe,” he said during a news conference. “It’s votes that matter, not money.”

Bloomberg’s political action committee, Independence USA, shelled out $12 million last year to unseat candidates who oppose gun control and gay marriage — and threw cash at those on his side of the hot-button issues.