A condition for the rationality of certain elliptic modular forms over primes dividing the level