The court also found 12 others guilty, including two Russians - alleged GRU secret agents - tried in absentia.
Prosecutors said the plotters had Kremlin support to assassinate then-Prime Minister Milo Djukanovic and block NATO accession.
Russia has called the coup inquiry absurd.
Montenegro's opposition has consistently rejected the charges, alleging what it called a "false-flag" operation - a fake act aimed at incriminating an opponent - to keep Mr. Djukanovic in power. He is now the president.
The opposition leaders jailed on Thursday are Andrija Mandic and Milan Knezevic - MPs in the Democratic Front Alliance.
The other defendants were another Montenegrin, nine Serbs and the two Russians tried in absentia.
The Russians, Eduard Shishmakov and Vladimir Popov, were handed the heaviest jail terms - 12 and 15 years.
Interpol has put out an international wanted notice for Popov. The investigative website Bellingcat says "Popov" is a pseudonym for a GRU officer called Vladimir Moiseev.
Bellingcat has previously researched Russian state involvement in the Ukraine conflict and Skripal spy case in the UK.
Tensions over NATO
Russia has condemned Montenegro's June 2017 accession to NATO.
NATO membership remains highly controversial in the small Balkan country, which became independent in 2006.
Serbia and Montenegro - both bombed by NATO planes in the 1999 Kosovo war - were originally one country after the break-up of Yugoslavia. At that time there was Russian support for the Yugoslav government.
What are the allegations?
Special prosecutor Milivoje Katnic said the plot involved using a sniper to kill pro-Western Prime Minister Milo Djukanovic. It was to happen on Montenegro's election day on 16 October 2016.
The plotters allegedly planned to break into parliament and bring a pro-Russian government to power.
Mr Katnic said "Russian nationalists" were involved, but he did not directly accuse any aides to President Vladimir Putin.
After the October 2016 arrests, Mr Djukanovic said around €125,000 ($140,000; £108,000) had been found as part of the alleged plot, along with uniforms.
Russia calls Montenegro's membership of NATO "damaging for the stability of the Balkans and Europe as a whole".
According to the indictment, dozens of cases of guns and ammunition were thrown into a lake in an unspecified neighbouring country. But the weapons were never shown in court.
Mr Djukanovic has dominated Montenegrin politics for more than two decades. He became prime minister for the first time in 1991 and last year he was re-elected president.
What about the other defendants?
The defendants can appeal against the verdict.
There was an 18-month jail term for Mihajlo Cadenovic, the Montenegrin driver working for Mandic and Knezevic, the two opposition leaders.
Bratislav Dikic, a former Serbian police general, was given eight years.
Pedrag Bogicevic and Nemanja Ristic, both members of Serbian ultra-nationalist groups, got seven years each, but in absentia.
Srboljub Djordjevic and Milan Dusic - both Serbs - got 18 months each.
Three more Serbs were also jailed: Branka Milic (three years), Dragan Maksic (a year and nine months) and Kristina Hristic (suspended term).
The judge said "each member of the criminal organisation had been assigned a task and there was a willingness to use violence and intimidation".