A word of warning: As I am sure you have heard many a time, md5 is a broken hash function. Storing passwords hashed with it is only slightly better than plaintext.
After much researching, including trying things out on my own system, I was unable to find a way of using an existing hash that has not been salted. If you still have access to the password, or access to someone who knows it, you can use
chpasswd -e to generate a salted hash.
If you have a salted hash, add the user to your system normally, if you haven't done so already. Pick any password you like, as we will overwrite it later.
/etc/shadow file, and edit the line starting with the username of your user. Replace the second field (after the first colon, and before the second) with this:
Where $salt$ is your salt, and $hash$ is the md5 hash in crypt base-64 format (https://www.linuxquestions.org/questions/linux-security-4/how-can-i-convert-a-sha-512-etc-shadow-hash-to-base64-4175477045/).
If the hash is unsalted, and you cannot gain access to the password through normal means, using something like
hashcat to break it for you could be a viable option.