Scientists from Scotland, Canada and US, said their studies of rocks on Barra and the Uists showed that hydrogen was formed after earthquakes.
Hydrogen is essential for supporting life, the researchers said.
The scientists said on Mars there are "Marsquakes" which may produce hydrogen in the same way as quakes on Earth.
The study, which has been published in the journal Astrobiology, was carried out by scientists from the University of Aberdeen, working alongside colleagues from Yale University in the US and Brock University in Canada.
Their research was supported by the Science and Technology Facilities Council and has been released amid preparations for Nasa's 2018 mission to the Red Planet.
Prof John Parnell, from the University of Aberdeen's School of Geosciences, said: "Earthquakes cause friction, and our analysis of ancient rock in the Outer Hebrides has demonstrated how this creates hydrogen.
"Hydrogen is a fuel for simple microbes, so microbes could live off hydrogen created in the Earth's subsurface as a result of seismic activity.
"This is a model that could apply to any other rocky planet, and on Mars there are so-called 'Marsquakes' that may produce hydrogen and therefore could feed life in the Martian sub-surface.
"Our analysis finds that conservative estimates of current seismic activity on Mars predict hydrogen generation that would be useful to microbes, which adds strength to the possibility of suitable habitats that could support life in the Martian sub-surface."
He added: "Nasa has plans to measure seismic activity on Mars during its 2018 InSight mission, and our data will make those measurements all the more interesting."
Analysis of rocks in the Western Isles has provided "a tantalising clue" that Mars may contain habitats which can potentially support life.