I didn't recognize the name but I recognized it when I ___.
I didn't know the title but I knew the ____ when I ____.
どんな話かによって言い方が少し変わります。例えば曲なら “I didn’t know the name of the song, but I recognized it when I heard it.” (曲名は知りませんでしたが、曲を聴いたら知っている曲でした。)映画なら “name” ではなくて “title” をよく使います。例えば “I had forgotten the title but I recognized the movie when I heard the plot.” (タイトルを忘れていましたが、映画のストリーを聞いたら知っている映画でした。)
When I just heard the title of the song, I didn't know it, but when I heard the actual song, I recognized it.
この場合、次のような言い方ができますよ。
ーWhen I just heard the title of the song, I didn't know it, but when I heard the actual song, I recognized it.
「曲名を聞いただけだとわからないけど、実際の曲を聴いたらわかった」
When I just 〜, I didn't know it, but when I ..., I recognized it. で「〜だけだとわからなかったけど、…だとわかった」と言えます。
ご参考まで!