City Comptroller John Liu will investigate a city agency’s dealings with a real-estate mogul who bought four Brooklyn buildings with the plan of converting them into homeless shelters.

Luxury hotel developer Shimmie Horn has been working with the Department of Homeless Services to turn buildings in Greenpoint, East New York and Brownsville into 200-bed shelters since March — and earn millions of dollars in the process, a Post investigation has found.

The move has outraged three city council members, who accused the agency of “pre-approving” Horn’s purchases.

A spokesman for Liu said his office would “hold the Department of Homeless Services accountable to a fair, transparent and equitable siting process.”