The data reports, and the larger issue of teacher evaluations, could well become a litmus test for the Democrats already fighting for the union’s crucial endorsement.

Some of them rushed to condemn the rankings’ release on Friday, though in different ways.

Bill de Blasio, the public advocate, mimicked the union’s line of criticism, saying, “The mayor’s persistence in denigrating teachers is completely at odds with our need to move New York City forward by attracting the best and brightest to the profession.” Christine C. Quinn, the City Council speaker, on the other hand, focused her fire on the courts, for siding against the union in its suit to block the release.

By positioning himself as the unbendable leader of the aggrieved, Mr. Mulgrew has at once bolstered his profile among the union’s rank and file and backed himself into a corner. One way or another, the state must put in place a system to judge the quality of its teachers and principals, as required by legislation passed in 2010 as part of its successful application for $700 million in federal education aid through the Race to the Top program. The alternative would be to forfeit it, a path Mr. Cuomo has already said he will not accept.

Mr. Bloomberg has given no indication that he is willing to budge on his plan to close and reopen 33 struggling schools so the city can dismiss half of their teachers. The plan is an effort to restore federal improvement grants suspended because of the lack of an agreement on the evaluation system.

Trying to capitalize on the attention and momentum that built over the data reports last week, the union plans to rebroadcast a television advertisement starting on Monday that first was shown earlier this month. In it, Mr. Mulgrew looks into the camera and says, “Work with us for better schools and a brighter future for all our students.”

Though many critics last week assailed The New York Times and other news organizations for publishing the ratings, the union has made the mayor its primary target, mostly shrugging off the role of the news media. That is a contrast to the union’s counterpart in Los Angeles, which picketed outside the Los Angeles Times building after the newspaper published teachers’ names and ratings in 2010.

The circumstances were different in Los Angeles — the newspaper had hired its own statistician to devise the rankings, while in New York, the city itself had compiled them and used them in tenure and other decisions. But the political lessons may be transferable.