So if a Muslim is on the Mars mission then how are they going to locate Mecca so they know what direction to pray?
Well, as a practical matter they just have to look up in the sky and find the brightest blue-green point of light...that will be Earth.
Just as a bit of trivia, I once read that from Mars one could see our Moon as separate (but much fainter) point of light, just next to Earth.