IIRC, the value assigned to the DOM id attribute is the layer id property concatenated with a suffix of "_layer". (of course since this is intended to be used internally by the JS API it's subject to change by ESRI without warning etc. sames goes for the intrinsic graphics layer too, i.e. perhaps this isn't a good approach...)