The first defendant, a 43-year-old identified only as Abdel A., was sentenced to two years and six months in prison while his accomplice Adel Al. was handed a jail term of one year and 10 months.
The superior court in Berlin said in a statement it "found that the accused systematically investigated for the Libyan secret services opposition figures living in the federal republic of Germany from August 2007 until their arrest on May 13, 2010."
Abdel A. was found to have managed a network of informants who gathered information on members of the opposition based in Germany and other western European countries and filed reports to his superiors in Libya.
Adel Al. worked as one of these informants, the court said.
Libya was among 17 countries and three territories listed by US watchdog Freedom House last year as having "extremely oppressive environments, with minimal basic rights and persistent human rights violations."