The Mayor Bill de Blasio aide charged with riding around with a loaded gun was nabbed in an SUV that reeked of marijuana, according to a criminal complaint.

Reagan Stevens, 42, was in the back seat of the 2002 Infiniti when she and two others were allegedly caught with the loaded 9mm Hi-Point semi-automatic pistol tucked in a green velvet bag in the glove compartment, court papers said.

Cops noticed there was a “strong odor of marijuana” wafting from the SUV, which was double-parked in Jamaica, Queens, near the scene of a shooting Saturday night.

Stevens — whose mother, Deborah Stevens, is a Queens Criminal Court judge and whose stepfather is an acting Queens Supreme Court justice — works as a deputy director in the mayor’s Office of Criminal Justice.

The Bay Ridge resident manages youth and strategic initiatives, including implementing a state law that will raise the age at which kids can be prosecuted as adults for nonviolent crimes from 16 to 18.

The gun, which had its serial number scratched off, was loaded with two rounds of ammunition, and a spent round was found on the driver’s-side floor.

Cops also found a paintball gun and carbon dioxide cartridges in the rear cargo area of the vehicle and a gravity knife in 25-year-old driver Caesar Forbes’ waistband.

Another man, Montel Hughes, 24, who was sitting in the passenger seat, was charged with marijuana possession after cops allegedly found five Ziploc bags of pot in his coat pocket, the complaint said. A gravity knife was also recovered from the pocket of his pants.

Stevens, Hughes and Forbes were each charged with two counts of criminal possession of a weapon. Forbes and Hughes were charged with criminal possession of a weapon related to the gravity knives and Forbes was ticketed for double parking.

Stevens was suspended without pay.

Their arrests followed a burst of five gunshots that activated an NYPD ShotSpotter gunfire detection device at 9:42 p.m. Saturday at 174th Street and 109th Avenue, sources said.

The trio was parked near the corner of 177th Street and 106th Avenue and arrested around 10:25 p.m.