The officers, expecting to crack down on a possible illegal fare, noticed a bulge underneath the man's jacket.
The bulge turned out to be a loaded World War II era Sten Mark II sub machine gun with a 30 round magazine, police said.
Elijah Coston, 21, of Newburgh was arrested and charged with Criminal Possession of a Weapon in the Second and Third Degree.
Coston is being held in Newburgh pending arraignment.
Police also ticketed the cab driver for failure to obtain a taxi permit.