Hundreds of neurotoxic insecticides are currently in use. However, only a few direct targets have been identified. Here, using Drosophila and the insecticide flonicamid, we identified nicotinamidase (Naam) as a previous unidentified molecular target for an insecticide. Naam is expressed in chordotonal stretch-receptor neurons, and inhibition of Naam by a metabolite of flonicamid, TFNA-AM (4-trifluoromethylnicotinamide), induces accumulation of substrate nicotinamide and greatly inhibits negative geotaxis. Engineered flies harboring a point mutation in the active site show insecticide resistance and defects in gravity sensing. Bees are resistant to flonicamid because of a gene duplication, resulting in the generation of a TFNA-AM-insensitive Naam. Our results, in combination with the absence of genes encoding Naam in vertebrate genomes, suggest that TFNA-AM and potential species-specific Naam inhibitors could be developed as novel insecticides, anthelmintics, and antimicrobials for agriculture and human health.