Ayoub B., 27, was given four years and three months, while Ebrahim H. B., 26, was handed a conviction of three years.
The two were “involved in the Islamic State of Iraq and Syria organisation between June and August 2014, and were therefore members of a terrorist group abroad,” the court in western Germany's Lower Saxony said in its ruling.
Both men had travelled to Syria to fight alongside jihadists from Isis (also called the Islamic State), but broke away from the group and returned to Germany disillusioned, according to German news agency DPA.
Ayoub B. was trained to handle weapons, said the court in a statement, and also helped Isis spread its propaganda with advertisements.
Among other contributions he made to the jihadist group was helping to transport wounded fighters from the front to a hospital, as well as detaining two Syrians and taking them to the organisation's self-proclaimed police.
The court noted that there was no evidence that his actions had led to any fatalities, and he could therefore not be held directly responsible for any deaths.
Ebrahim H.B., meanwhile was found to have fought alongside the jihadists, and was on standby as a potential suicide bomber. He also promoted Isis propaganda online.
Germany's domestic spy agency estimates that around 750 Islamists have left the country to join jihadists in Syria and Iraq, and that one in three has returned.
European authorities are increasingly concerned about the threat that returning jihadists pose on their home soil, particularly following the deadly Paris attacks, which French authorities said were planned by Belgian national Abdelhamid Abaaoud, who had fought for Isis in Syria.