The first time I noticed one of these buildings, I wasn't sure what it was. But having seen a number of them now, I recognize the key features, particularly the windows. It's a well pumping station formerly operated by the Jamaica Water Supply Company (JWS).
With a network of groundwater wells, JWS once provided water to southeastern Queens and parts of Nassau County. NYC bought the Queens wells in 1996, but hasn't used any of them for drinking water since 2007; all of the city's water — more than a billion gallons per day — now comes from upstate reservoirs. About half of that supply is carried toward the city through the Delaware Aqueduct, which will have to be shut down for several months for repair work around 2022. There was talk of rehabilitating the wells in Queens to help compensate for the loss of water while the aqueduct is out of service, but, as far as I can tell, that plan is no longer being considered.