* Putin opponent is underdog against Kremlin appointee
* Navalny faces five years in prison if he loses appeal
* Strong showing after lively campaign could rattle Kremlin (Adds Navalny and Sobyanin voting, vox pops, other detail)
By Gabriela Baczynska
MOSCOW, Sept 8 (Reuters) - Russian opposition leader Alexei Navalny faced off against a Kremlin ally on Sunday in a Moscow mayoral election with high stakes for both President Vladimir Putin and his foes.
The contest to head Russia's capital will help shape Putin's six-year third term and the fortunes of two politicians who could play bigger roles in the future.
For underdog Navalny, 37, an anti-corruption campaigner who emerged from a wave of street protests as the driving force of opposition to Putin's 13-year rule, the vote is a chance to show many Russians want change and he is the man to make it happen.
It pits him against Sergei Sobyanin, a former Putin administration chief who was appointed to a five-year term by the Kremlin in 2010 but called an early election to bolster his legitimacy and strengthen his position.
Irina, a Muscovite in her 40s who works in manufacturing and on Sunday voted with her father, cast her ballot for Navalny in a sign of protest against the Kremlin.
"We've both voted for Navalny, we like some things about him but first and foremost we really don't like the authorities," she said.
Worker Yevgeni chose Sobyanin.
"There is no need for any change, everything is fine here. He's got serious experience now, he's well into this job. I like the way he works and want to see more of the same," he said, adding his main demand was for more jobs.
But even among those who voted for Navalny, there was little hope he could win and a threat of jail hangs over him.
OPPOSITION CANDIDATE FACES JAIL
He was convicted in July of stealing timber for a state firm and sentenced to five years in prison after a trial he and his supporters say was politically motivated.
In a highly unusual ruling, a judge released him the following day pending a ruling on appeal, enabling him to continue his mayoral campaign.
"I hope there will be no violations today, I'd very much want Muscovites today to finally be able to express their will and chose the mayor they want," Navalny, flanked by his wife Yulia and their two children, said on leaving his polling station in southern Moscow.
Sobyanin, wearing a dark suit as in most of his public appearances, waited in a short queue with his wife before they cast votes in the centre of the capital. They made no comments.
Many political analysts say the Kremlin wanted Navalny to run because it expected him to be humiliated and believed this would wipe out any political threat from a critic who has presidential ambitions.
But while opinion polls have shown Navalny has little or no chance of winning, his lively campaign has revived some of the enthusiasm of a flagging protest movement and may have rattled the Kremlin.
A strong showing for Navalny could deepen Kremlin concerns and boost the morale of Putin's opponents - particularly if Sobyanin were to fall short of 50 percent of the votes, forcing him into a run-off vote later this month.
Most polls have shown that is unlikely and the Kremlin seems confident it will not happen. Kremlin sources said Putin was pencilled in to attend the mayor's inauguration this week.
Navalny and Sobyanin, 55, are among six candidates fighting for the ballots of nearly 7.2 million registered voters in Russia's biggest and wealthiest city, its main financial centre and the seat of most big Russian companies.
Moscow accounts for more than a fifth of Russia's economy and the race is the most prestigious of some 7,000 regional and local elections taking place in the country on Sunday. Voting in Moscow is due to end at 1600 GMT. (Additional reporting by Alexei Anishchuk; Writing by Steve Gutterman; Editing by Robin Pomeroy and Angus MacSwan)