In what will be the city’s largest office transaction this year, Worldwide Plaza is in contract to be sold to a joint venture led by George Comfort & Sons that includes RCG Longview and the building’s lender, Deutsche Bank.

As part of the deal, the group will put up $175 million in equity on top of what will be an approximately $450 million mortgage.

The deal, which The Post first reported last week was in the works, will include the restructuring of the $800 million-plus mortgage by Deutsche Bank in exchange for the bank getting an equity stake.

The lender is taking back the 50-story Midtown tower from Macklowe Properties, which bought it and six others from Equity Office Properties in 2006 for $7.1 billion. Macklowe has since lost all of those buildings, plus its centerpiece, the GM Building.

Eastdil Secured marketed Worldwide Plaza, but was hampered by a sharp drop in the property’s value. Also plaguing it is the tower’s need of a capital infusion to update the 20-year-old structure, which will be half vacant when Ogilvy & Mather moves out in the near future.

Its other occupant, law firm Cravath Swaine & Moore, signed a renewal that requires upgrades.

Brokers had been reluctant to bring over large tenants because of the ongoing attempts to sell the building and restructure its ownership. Indeed, that uncertainty helped scuttle a deal last year for NBC to take up space in the tower.

Richard Baxter, an investment broker with Cushman & Wakefield, who was not involved with the deal, said, “This speaks to the long-term investors who believe New York City is still the best place to invest capital in real estate.”

RCG Longview includes the Feil organization, their investment partner Jay Anderson and Peter Cohen and Michael Boxer’s Ramius capital.