McCormack, 51, will be guest starring on Messing's show, as her ex-fiance Dr Andrew Devlin, reported E! online.
His character is of a 'roguish, arrogant-as-can-be heart surgeon', who happens to have been engaged to Laura once upon a time. His ex-wife has been murdered, and he becomes Laura's lead suspect. Apparently, sparks will fly between the two.
'Will & Grace' ran on NBC for eight seasons from 1998 to 2006.
'The Mysteries of Laura' follows Messing, 46, as Laura Diamond, a homicide detective, who has to juggle her life as a detective along with her life as the mother to two twin boys.