With a midnight strike deadline looming, Macy's and Local 1-S of the Retail, Wholesale and Department Store Union (RWDSU), the union representing 4,000 workers in four New York stores, reached a tentative five-year agreement to avoid a strike.

The agreement must be approved by the union through a vote. Workers voted last week to approve of a strike if an agreement was not reached by midnight Wednesday.

Macy's and its employees from stores in Herald Square, Queens, Westchester and the Bronx were negotiating over health care benefits, wages and the company's policy toward assigning shifts.

A representative from the Local 1-S unions was not immediately available for comment.

This tentative agreement reflects tremendous efforts by company and union negotiators over the past several weeks to reach an agreement that addresses the economic and business realities of the retailing industry, while keeping jobs at Macy's among the best in the department store industry, the company said in a statement.

Follow Matthew Rocco on Twitter at @MatthewRocco