This is what I found. So DM is superior in ranking.
An IPS has only the responsibility of its department, but an IAS (DM) has the responsibility of all the departments of the district. An IAS officer as DM is the head of the police department and other departments. As per one protocol, the IPS officer needs to salute the IAS if he is senior to him.
OK only if senior