Yes, you could say that. It could imply that a class of 10 becomes a class of 5. If on the other hand, you mean to divide a class of 10 into two classes of 5, you could be clearer saying something like:
"Divide the class in two halves" or "Divide the class in two."