The man allegedly ran from police when they approached him at the intersection of Linden Boulevard and East 49th Street in East Flatbush just after midnight.
The suspect led dozens of officers on a manhunt for about an hour. Then, he exchanged gunfire with police and was shot.
He ran again and was eventually found hiding under a car.
He is expected to survive.
There is no word on the circumstances of the initial stop or what charges the man is facing.