Aug. 22 (Bloomberg) -- There is little question that generous pay and pensions for public employees contributed mightily to the economic straits that many states find themselves in.

State and local governments pay workers $40.10 an hour in wages and benefits versus $27.88 for private-sector employees, according to the Bureau of Labor Statistics. (Studies that control for factors such as education and experience have found much smaller disparities.) But recent weeks have offered solid proof that limiting collective-bargaining rights for those workers’ unions is not the right approach to bringing the situation under control.

On Thursday, Connecticut’s state employees approved a contract producing $21.5 billion in cuts over 20 years, a deal that the union had reached with Governor Dannel P. Malloy but had been rejected by members in June. State balance sheets will benefit from a two-year wage freeze for workers, who will also have to be older to retire, wait 10 years instead of five to get retiree health benefits, and make contributions to a health-care trust for a decade. In return, employees received a four-year no-layoff guarantee and a promise they would not be forced to take unpaid furloughs.

Although a change in the union voting process, which was encouraged by labor leaders who favored the deal, surely had some effect on the different result this time around, there is little question that the agreement reached Monday between New York and its largest public-worker union was a dose of reality that jolted state employees in Connecticut and across the nation.

The New York pact, with the Civil Service Employees Association, is expected to save a modest $73 million this year, but Governor Andrew Cuomo projects that reaching similar deals with the state’s other unions would reap $1.6 billion over five years.

On the part of organized labor, the deals showed a welcome recognition of the depth of voter concern over budgets and, perhaps, a new appreciation that it is going to take shared sacrifice to get the U.S. out of this economic mess.

The political lesson here is that a tough stand by elected officials can achieve real gains at the bargaining table without having to limit the collective-bargaining rights of unions, as Governor Scott Walker of Wisconsin has done and a law passed by Ohio legislators would do. To his credit, Ohio Governor John Kasich has sought compromise with unions in advance of a referendum in November to repeal Ohio’s law, which has yet to take effect. Union leaders there would do well to take up his invitation.

There are competing theories as to who “won” the Wisconsin battle over collective bargaining that this month cost two Republican legislators their jobs through a recall election. But there is no doubt as to the costs: political acrimony, frayed social fabric and the triumph of forced sacrifice. New York and Connecticut have shown that skillful political leadership can achieve real savings while preserving comity, reinforcing the need for all Americans to voluntarily give up something to ensure a prosperous future.

To contact the Bloomberg View editorial board: view@bloomberg.net.