The Curiosity Rover, which has been on the Red Planet for nearly three years, found the molecule that is essential for life in the form of nitric oxide released during heating of Martian sediments.
Nitrates are a class of molecules that contain nitrogen in a form that can be used by living organisms.
Nasa said the discovery added to growing evidence that ancient Mars was habitable for life.
Nitrogen is used in the building blocks of larger molecules like DNA and RNA, which encode the genetic instructions for life, and proteins, which are used to build structures like hair and nails, and to speed up or regulate chemical reactions.
"Finding a biochemically accessible form of nitrogen is more support for the ancient Martian environment at Gale Crater being habitable," said Jennifer Stern of Nasa's Goddard Space Flight Center.
But rather than having been created by life, the team believes the nitrates likely came from non-biological processes such as meteors and lightning striking the planet in Mars' distant past.
"Scientists have long thought that nitrates would be produced on Mars from the energy released in meteorite impacts, and the amounts we found agree well with estimates from this process," she explained.
The Curiosity team has already found evidence that other ingredients needed for life, such as liquid water and organic matter, were present on Mars.