* Top court rules by 3-2 margin against Zurich prosecutors
* Hands victory to whistleblower Elmer after 14-year battle
* At stake was whether Swiss banking secrecy applies abroad (Adds quotes and background)
LAUSANNE, Switzerland, Oct 10 (Reuters) - Switzerland's highest court ruled on Wednesday that prosecutors cannot extend Swiss banking secrecy rules to all corners of the globe to pursue whistleblowers and other leakers at foreign subsidiaries.
The Federal Supreme Court by a 3-2 majority rejected an appeal by Zurich prosecutors in a 14-year legal battle involving former private banker Rudolf Elmer, who had been acquitted of breaking secrecy laws.
The case underscored how Swiss authorities continue to pursue people who leak client data even as strict banking secrecy erodes in an era of automatic sharing of account data among tax authorities to catch cheats.
Elmer, who headed the Cayman Islands office of Swiss private bank Julius Baer until he was dismissed in 2002, later sent documents with details of alleged tax evasion to the anti-secrecy group WikiLeaks and to tax authorities across the globe.
The Swiss Banking Act requires employees of Swiss-regulated banks to keep client information confidential, but a number of staff have leaked account details to foreign authorities in the past decade as Western governments crack down on tax evasion.
Some lawmakers in the European Union worried that the prosecutors' move, if successful, would deter potential whistleblowers from supplying information on people accused of shifting wealth to tax havens through accounts protected by secrecy laws.
Zurich prosecutors had asked the court to interpret the law so that the secrecy obligation was widened to include people with looser working relationships to Swiss banks and their subsidiaries abroad.
They were appealing against the 2016 acquittal of Elmer on charges brought under the secrecy law.
Elmer, who was in the courtroom, expressed relief at the verdict. "My reaction is positive, definitely," he told Reuters, calling the verdict -- which is final -- a blow to tax dodgers trying to hide behind Swiss banking secrecy. "Especially foreign employees will feel much more comfortable that they are not being exposed to any legal cases about violating Swiss bank secrecy," he said.
His attorney Ganden Tethong said: "It was made clear by the court that Swiss bank secrecy law is not applicable to banks in countries outside of Switzerland. I think that was very clear today and I'm glad it is now clear for all."
Zurich's upper court ruled in 2016 that the bank secrecy law did not apply to Elmer as an employee of a Caribbean subsidiary, rather than of the parent bank in Zurich. The top court upheld this view.
Prosecutors had argued in their appeal that if they could not apply the law to people connected to Swiss banks outside the country, this deprived banking secrecy of its substance "with far-reaching consequences that cannot be accepted."
Switzerland, the world's largest center for overseas wealth management, has responded to international pressure, especially from the EU and United States, for greater transparency.
This includes joining the Automatic Exchange of Information program among developed economies which aims to ensure that offshore accounts are known to tax authorities where the account holders live.
Still, Swiss banks are fighting to shed a reputation of being a place to stash wealth beyond the prying eyes of the tax man. UBS is on trial in France for this.
Prosecutors had sought a 36-month jail sentence for Elmer, of which 24 would be suspended. The Zurich upper court had given him a suspended sentence for forging documents and threatening Julius Baer following his dismissal. That ruling stands. (Writing by Michael Shields; Editing by Toby Chopra)