Emboldened by the results of this month’s Democratic primaries, in which five council incumbents were defeated and a sixth held on by a whisker-thin margin, critics of Quinn (right) are assessing whether there’s an opening for a coup.

At least four of the five losers were reliable Quinn allies. Tom White (D-Queens), another ally, squeaked through by five votes.

Sources said Brooklyn Democratic leader Vito Lopez, whose relationship with Quinn is strained, is planning to meet with his Bronx counterpart, Carl Heastie, to determine whether they can round up the 26 votes needed to install their own candidate in the speaker’s job.

Some council members are also trying to press Quinn into a corner and spark an uprising within the council by demanding that she endorse city Comptroller Bill Thompson for mayor over her longtime ally Mayor Bloomberg.

“If she endorses Bloomberg, she’s dead,” one council member said.

So far, Quinn hasn’t taken a position in the mayor’s race.

Sources describe Quinn as “extraordinarily confident” that the coalition that first elected her, organized by Queens Democratic leader Joe Crowley, will hold firm.

But she’s not taking any chances.

She’s meeting with each council member individually and is preparing to offer leadership roles to minority members who will soon likely hold 28 of the 51 seats.