A Long Island teacher claims his job went south after he filed for divorce from his wife — just before she became his supervisor in the science department of his high school, according to federal court papers.

North Babylon High School biology teacher John Jaeger claims in his suit filed on Long Island that ­angry ex Kristy Middleton tried to force his ouster by trumping up harassment complaints against him and sabotaging his job performance.

Jaeger says that he has been ­effectively shut out of the school’s science department despite a stellar record.

Neither Jaeger nor Middleton nor the school district responded to requests for comment.