Alt-F11 is the way to escape from the otherworldly dimention known as the void.
However, if you are lost in a dungeon and can't teleport out, then it won't help you. You'll just have to find the exit.
If the mini-map and automap are not helping you locate the exit, try a "bread crumb" technique. Drop junk every now and then as you explore around, so if you wind up coming around in a circle, you know you've been there before.