Teachers in Florida filed a lawsuit in federal court Tuesday, claiming the state’s new teacher evaluation system is unfair because it partly rates their job performance on test scores of students they don’t know and subjects they don’t teach.

The lawsuit — backed by local teachers unions and their parent organization, the National Education Association — marks the first time teachers have brought a legal challenge to new evaluation systems that base compensation and job security on student scores.

Filed in U.S. District Court in Gainesville, the complaint names the state education commissioner, the state Board of Education and three school districts.

Alice O’Brien, general counsel for the NEA, argued that the Florida evaluation system violates constitutional guarantees of due process and equal protection. The union is seeking an injunction to halt the system, which the state legislature approved in 2011.

“Seven accomplished educators in Florida are pushing back against an arbitrary, unfair, irrational evaluation system,” said Dennis Van Roekel, president of the NEA, the nation’s largest union. In a conference call with reporters, he said legal action could follow in other states.

Tony Bennett, Florida commissioner of education, said Tuesday that Florida’s performance pay law “helps us recruit and retain teachers,” but he said there is another piece of legislation under consideration that would call for evaluating teachers only on the students and subjects they teach.

He said the department of education wants to work with teachers and Florida families as they “ensure a fair and appropriate assessment that best rewards the success of our great teachers.”

Since 2009, 36 states and the District of Columbia have required that teachers be evaluated in part based on student scores on standardized tests. The idea has received a boost because of Obama administration policies, particularly Race to the Top.

Under federal law, every state tests students annually in reading and math in grades 3 through 8 and once in high school. That omits large numbers of younger and older students as well as other subjects, including art, music, science, health and social studies.

When rolling out new teacher evaluation systems, school districts have faced a predicament: How do you judge teachers who educate students in grades that are not tested or in subjects the tests don’t cover? How do you use math and reading scores to evaluate an art teacher?

Officials in Florida, Tennessee and the District decided to evaluate those teachers by using test scores of other teachers’ students.

The Florida complaint cites the case of Kim Cook, a 22-year educator who teaches first grade at W.W. Irby Elementary in Alachua County. Because Irby is a school for children in kindergarten through second grade, its pupils are too young to take the state’s standardized test, known as the Florida Comprehensive Assessment Test.

When it came time to rate the Irby teachers this year, the local school board decided that Cook and other teachers would be judged by the test scores of all fourth- and fifth-grade students in another elementary school.

“I never met or instructed the students at Alachua Elementary,” said Cook, one of seven teachers who are plaintiffs in the lawsuit.

The fourth- and fifth-graders at Alachua did not perform well on the standardized tests. Since 40 percent of Cook’s evaluation depended on those test scores, she was initially given an “unsatisfactory” rating at the same time her colleagues honored her as Teacher of the Year.

State lawmakers are considering changes to the evaluation system — to require that teachers be evaluated on the performance of their own students — but union officials said that legislation is not moving quickly enough.