In a class taught by a man, girls were more likely to say the subject was not useful for their future. They were less likely to look forward to the class or to ask questions.
Dee said he isolated a teacher's gender as an influence by accounting for several other factors that could affect student performance. But his study is sure to be scrutinized.
"The data, as he presents them, are far from convincing," said Marcia Greenberger, co-president of the National Women's Law Center, which works to advance the progress of women.
Greenberger said she found Dee's conclusions to be questionable and inconsistent. More broadly, she said, boys and girls benefit by having male and female teachers as role models.
"I don't think there are many parents or students, looking back over their educational careers, who haven't been inspired by a teacher of the opposite sex," she said.
"And many have had very unhappy experiences with teachers of the same gender that they are. We have to be careful of too many generalizations," Greenberger said.
Student success cannot be narrowed to the gender of the teacher, said Reg Weaver, president of the National Education Association, the country's largest teachers' union.
Experienced teachers, good textbooks, smaller class sizes and modern equipment all influence how boys and girls do in class, Weaver said.
Dee said his research raises valid questions.
Should teachers get more training about the learning styles of boys and girls? Should they be taught to combat biases in what they expect of boys and girls?
In the nature-nurture debate, he said, teacher gender belongs.