Within the main canon, Moriarty's "ship in a bottle" is never mentioned again after TNG: Ship in a Bottle, although the events of the episode (as an instructive warning) do receive a very brief and tangential reference in VOY: Alter Ego
CHAKOTAY: Most likely a sentient computer programme. I checked the Starfleet database. This kind of thing has happened before. The Enterprise-D under Picard was once taken over by a holocharacter.
Moriarty's program is mentioned as having survived the crash of the Enterprise in the TNG Pocket Novel: The Light Fantastic
Moriarty explains to Lal and Alice that the destruction of the Enterprise-D affected his and Regina's world, wiping their two daughters out of existence. Their programme was transferred to the Daystrom Institute but a further disruption during Vaslovik's raid on the facility saw the rest of their world wiped out.
It was one of the items the Soong Foundation (for the Advancement and Emancipation of Artificial Lifeforms) was interested in acquiring. The Federation apparently refused to entertain the idea.
And the legal fight for civil rights for artificial lifeform hit a snag over the hologram known as "Moriarty." Alerted to its existence in a Starfleet computer, the Soong Foundation sued to have the program released into its custody.
Attorneys for Starfleet argued that Moriarty and his companion were a security risk, and that the program's attempt to take over the U.S.S Enterprise-D in 2369 allowed Starfleet to keep it in indefinite custody to protect the public. "That's just imprisonment without a trial," argued Alyssa Cogley-Shaw, lead attorney for the Soong Foundation. "Since when did Starfleet turn into the Obsidian Order?"
Star Trek Online: 2029 Lore