An NYPD drone was utilized to track — and then help arrest — a 49-year-old Brooklyn man armed with what appeared to be a loaded pistol during a daytime standoff in downtown Brooklyn yesterday, officials said.

After trying to communicate with the man for more than four hours, the Court St. resident surrendered and was taken to a hospital, cops said. The gun he had turned out to be fake.

NYPD Emergency Service Unit cops were called in to talk to the man, while officers from the department’s Technical Assistance Response Unit used an untethered drone to watch from a window.

The drone was also used in the man’s surrender, officials told the New York Daily News.

“We were able to ask the individual to take the gun and bring it over to the window, which he did,” said TARU Deputy Inspector Frank DiGiacomo. “Utilizing the drone, we were able to see that, yes, in fact he put the gun down, so were confident that when he came to the door he was unarmed.”