If you know the subject well that you are teaching, and the students know that it is not your specialty, then there is nothing wrong with you teaching them. But if you do not know it well or you give them the impression that this is your speciality, then it is not permissible, because that is deceiving them. The student is looking for a specialized teacher and dealing with him on that basis, so you should tell him the truth so that he will know what is going on, otherwise it is deceiving him.
Muslim (101) narrated that the Prophet (peace and blessings of Allaah be upon him) said: “The one who deceives us is not one of us.”
And Allaah knows best.