But Riker is supposedly himself when spotting the registry and apparently from that fact alone deriving the conclusion that the ship with this registry is USS Yamato
. Unless Nagilum was inside everybody's skull already, making them do crazy things and think incorrect thoughts, it is a Starfleet fact that a ship numbered NCC-1305-E is named Yamato
That is, the name (which Riker cannot see) seems to be derived from the registry (which Riker can see) in a process where Riker reads out the registry and then
comes up with the name. There's no need for "outside" confirmation - Riker's word suffices. Unless he's possessed.
Worf seems jittery in the episode - but the teaser already establishes as much. He's probably undergoing puberty or something. The other heroes begin to act abnormally only when directly subjected to the Nagilum's whims, and the actions are short-lived and rather blatant. It doesn't appear, say, that the "Troi" and "Data" visiting Picard in his cabin would be the real crew members possessed; rather, they are illusions out of whole cloth. Having Riker be possessed just for the duration of creating a false connection between a registry and a name doesn't seem to fit the pattern.
As for Worf being an expert on the Yamato
bridge, all he says is that he's acquainted with the ship. He isn't necessarily saying there's anything special about the sister ship - merely that he isn't completely lost and for that reason is entitled to make a tactical recommendation to Riker.