Starting in the 1850s, to meet the needs of its rapidly growing population, the then-independent city of Brooklyn constructed the Ridgewood Reservoir atop the Harbor Hill Moraine in what is now Highland Park and built an aqueduct system to supply it with water from a series of dammed streams and wells located farther east on Long Island, in today's Queens and Nassau Counties.
The abandoned structure above stands at the eastern edge of Queens along the route of the conduits that once carried this water toward Brooklyn. The western portion of the aqueduct was gravity-fed, so this pumping station wouldn't have been needed to move water through the pipes; it must have been used to pump water up from Hook Creek (which once marked this part of the boundary between Queens and Nassau before it was covered over) and add it to the supply heading toward Ridgewood.
As far as I can tell, Hook Creek was not one of the original water sources for the aqueduct.* Lending some support to that claim, the inscription above the doorway ("CITY OF NEW YORK — DEPT OF WATER SUPPLY G&E — HOOK CREEK PUMPING STA") implies that this pumping station was erected by New York City, of which Brooklyn was not a part until 1898. I do know that NYC built mechanical filtering plants for some surface water sources in the early 1900s to increase Brooklyn's supply; perhaps this building was constructed, and Hook Creek finally tapped, at that point.
* Confusingly, what is now called Hook Creek was, in the mid-1800s, sometimes just referred to as the middle branch of Hook Creek. The east and west branches, however, were original sources for the aqueduct. An 1853 NY Times article describing an inspection tour of some of the proposed water sources for the new Brooklyn supply system deemed the pond on the east branch of Hook Creek (later known as Clear Stream and now buried beneath the streets of Nassau County) the finest of the bunch: "This water seemed much superior to that of the other ponds, and could be tasted moderately without the brandy — though the majority still continued to think a little of the latter a decided improvement."
UPDATE: This was a driven well station, meaning it drew water out of the ground, not out of Hook Creek. The wells were put into operation around 1910. In April 1939, residents of Rosedale were begging the city to activate this pumping station, which had been temporarily shut down, in order to lower the area's water table and bring an end to the basement flooding caused by recent rains. (As we've seen, flooding is a perpetual problem in Rosedale.)