Nachtmahr doesnt mean Nightmare in German (it calls Alptraum). Nachtmahr is a rare Word for an Evil Ghost/Spirited Horse Rider.
Technically "Nachtmahr" translates to night mare. However it is nowadays rarely used as a word for nightmare but rather as a word for the creature that brings nightmares.
Another word for "Nachtmahr" is "Nachtalb" which is where the word "Albtraum/Alptraum" originates from.