Starting with version 2.0 of the game engine of both Dungeon Master and Chaos Strikes Back, FTL has included an actuator (type 9 on a floor tile) to check the version of the game engine.
Meynaf created a custom dungeon using this actuator to detect the version of the game. The dungeon is pretty simple: just walk in the corridor until you find a scroll on the floor. The game version will be written on the scroll.
For pre 2.0 versions, the scroll will not tell the exact version because the actuator does not work.
The dungeon also recognizes Dungeon Master II but does not display the version number. However all known versions of Dungeon Master II have version number 1.0.