The Queens gym teacher who had sex with two underage students won’t face any jail time long as she completes a year of mental-health treatment.

Joy Morsi, 40, pleaded guilty in Queens Supreme Court Friday to one count each of rape and criminal sexual act charges and will have to attend an out-patient program for a diagnosed depressive disorder, according to the Queens DA’s Office.

The married mom of four will then receive 10 years probation following completion and will have to register as a sex offender.

Morsi, of Massapequa, Long Island surrendered her teaching license Friday as a result of the trysts with the two students at Grover Cleveland High School in Ridgewood.

Her first fling with the then-16-year-old student wrestler started in June 2013, when he emailed her about needing help losing weight, prosecutors said.

The two had sex more than 20 times at the school and in various places, like the basement and gym.

Morsi, who is married to a science teacher at the same school, Hany Morsi, also sent the teen dirty selfies.

But when their relationship ended nearly a year later, Morsi grew jealous over her ex-boy toy’s prom date — and then seduced another 16-year-old boy.

“I can’t believe [name deleted] is going to the prom with [name deleted],” Morsi texted to the second boy, according to a source with knowledge of the text.

The gym teacher exposed herself and performed a sex act on the second boy, authorities said.

Reached at her home, Morsi — dressed in pajamas and slippers — slammed the door in a reporter’s face.

Her attorney, Virginia Lopreto, didn’t return a message seeking comment.