Which zemirot were written for occasions other than the ones they are currently used for? "Hamavdil", for instance, which we sing after the end of Shabbat, fits motzaei Yom Kippur (or Shabbat Shuvah?) very well. Presumably it was written with one of those occasions in mind. But that's common knowledge.
Similarly, it could be that "Tzama nafshi", which is listed as one of the Shabbat zemirot, was actually written for Rosh Hashanah. Almost every line expresses a main theme of Rosh Hashanah. (I don't have time to write this up; check for yourself.) Meanwhile, there is no mention of Shabbat. Plus, its well-known tune is not inappropriate for Rosh Hashanah.
Even if this hypothesis is wrong, and (for example) Tzama Nafshi was perhaps written for no particular occasion but just as nice religious poetry - nevertheless, all the Rosh Hashanah-like qualities make it a great song to sing on Rosh Hashanah. (Or, for that matter, Shabbat Shuvah, seeing as I missed my chance to post this before Rosh Hashanah.)