Eddie Martins and Richard Hall arrested the woman for possession of marijuana before having sex with her in the back of a van in exchange for her release.
They will serve five years probation but escaped the prosecutor's request for one to three years in prison.
The men were initially accused of rape but the charges were later dropped.
On Thursday the former police officers, both in their mid to late thirties, pleaded guilty to official misconduct and other charges linked to the incident.
The police officers pulled the woman over in September 2017 as she was driving with friends and found her to be in possession of marijuana.
They then took turns to have sex with her in the back of the police vehicle, the court heard. The police officers did not report the arrest.
Afterwards, the woman went to hospital, where tests identified DNA matching both detectives.