As well as handing out the two prison sentences, the court gave three youths six-month suspended sentences.
Another, who was accused of throwing projectiles at police, was acquitted.
Four others were to appear in court on Thursday, accused of obstruction or violence against the police.
There was more violence on Wednesday night, despite an appeal for calm by the victim, 22-year-old Théo, who is still in hospital after allegedly being raped with a police baton.
Twenty-eight people were arrested in the Seine-Saint-Denis region north of Paris, police sources said, and damage included a nursery school and a car dealership set on fire.
Most of the clashes were not in Aulnay-sous-Bois, where the assault took place, but in neighbouring towns, including Clichy-sous-Bois, the centre of rioting in 2005 after the deaths of two youths who were pursued by police.
There were also demonstrations "against police violence and in solidarity with Théo" in the western cities of Rennes and Nantes, where 17 people were detained for offences including refusal to submit to identity checks and carrying weapons.
A police officer has been charged with rape and three others with assault but an initial police inquiry has found insufficient evidence of rape, police sources told the AFP news agench on Wednesday afternoon.
The junior minister responsible for assistance to victims, Juliette Méadel, praised Théo's call on people not to "make war" and said his assault was probable racist.
"Young Theo has said only the most admirable things, he's called for calm," she commented after President François Hollande visited him in hospital on Wednesday.
"If the allegations of misconduct and that he was the victim of the most despicable police violence, probably motivated by racism, are confirmed, then his gesture is even more praiseworthy."
Former housing minister Cécile Duflot, a member of the Green party EELV, also praised his "enormous restraint", saying the incident was a symptom of "police at the end of their tethers and youth who are running out of patience".
"There is racism in society," she commented. "It has to be fought always and it exists in the police, of course. That's not stigmatising the police just as it's not stigmatising the youth when you say there are young people who are delinquents."
Right-wing presidential candidate François Fillon was les forthright.
The assault has "yet to be proved", he said on a visit to Juvisy-sur-Orge near Paris, but "these individuals have committed misdemeanours and must be punished".
"That should lead us ... to demonstrate our solidarity with the police and at the same time be intransigent with this sort of behaviour," he added.
Théo, who was wearing an Inter Milan shirt when Hollande visited him, has been invited by the Italian football club to attend a game as soon as he has sufficiently recovered.