Nagai was born in the Myōdō District, Awa Province in what is now the Tokushima Prefecture, as the son of a doctor and started studying rangaku medicine at the Dutch Medical School of Nagasaki (Igaku-Denshujo) in 1864. While in Nagasaki, he made the acquaintance of Ōkubo Toshimichi, Itō Hirobumi, and other future leaders of the Meiji government.
Nagai continued his studies at Tokyo Imperial University and became the first doctor of pharmacy in Japan. He was sent under government sponsorship to Prussia in 1871 to study at the University of Berlin. He was the only civilian in a group of military students sent to study in Great Britain and France, and he traveled by way of the United States and Great Britain. While in Berlin, he resided at the home of Japanese diplomat Aoki Shūzō. He was influenced by the lectures of von Hofmann, and received a doctorate with a study on eugenol while working as an assistant at von Hofmann's laboratory. He decided to take up organic chemistry in 1873.
Nagai returned to Japan in 1883 to take up a position at the Tokyo Imperial University, and became Professor of Chemistry and Pharmacy there in 1893. His research centered on the chemical analysis of various Japanese and Chinese traditional herbal medicines.
While in Germany, Nagai married Therese Schumacher, the daughter of a wealthy lumber and mining magnate. On their return to Japan, she became a professor of German language at Japan Women's University, and was active in introducing German foods and culture to Japan. In 1923, Nagai and his wife hosted Albert Einstein and his wife during their visit to Japan.
As first president of the Pharmaceutical Society of Japan (PSJ, founded in 1880); Nagai had an important impact on the propagation of chemistry and pharmaceutical sciences in an industrializing Japan.
Nagai died in 1929 in Tokyo of acute pneumonia.
- Isolation of ephedrine from Ephedra vulgaris in 1885. Nagai recognized it to be the active component of the plant.
- Synthesis of methamphetamine from ephedrine in 1893. Methamphetamine was later synthesized in crystalline form in 1919 by Akira Ogata.
- Isolation of rotenone from Derris elliptica in 1902. Nagayoshi named the substance after the Japanese name for the plant, roten.
- Synthesis and structural elucidation of ephedrine in 1929.
- Lock, Margaret. East Asian Medicine in Urban Japan: Varieties of Medical Experience. University of California Press; Reprint edition (1984). ISBN 0-520-05231-5
- Schultes, Richard Evans, ed. Ethnobotany: The Evolution of a Discipline. Timber Press, Incorporated (2005). ISBN 0-931146-28-3
- W Pötsch. Lexikon bedeutender Chemiker (VEB Bibliographisches Institut Leipzig, 1989) ISBN 3-8171-1055-3
- 日本の近代薬学の開祖 長井長義とは 徳島県製薬協会