They are entirely different languages.
The number of languages in the Ryuukyuu Islands is not entirely clear, mostly due to different definitions of what counts as a 'separate language', and the general lack of good, comprehensive documentation. Nonetheless, there are traditionally five counted as separate:
- North Ryuukyuuan: Amami, Okinawan
- South Ryuukyuuan: Yaeyama, Miyako, Yonaguni
These five are clearly separate languages by basically any scientific definition, and there are almost certainly more, depending on the criteria you use. For example, the language of Nakijin on Okinawa seems different enough from that of Naha (the 'main' one) to be a separate language, and some of the variety between islands in the Yaeyama archipelago suggests there might be five or six languages within 'Yaeyama' alone. I'd hazard a conservative guess that there are really more like eight or nine Ryuukyuuan languages at a minimum, and maybe closer to twelve or thirteen depending on what counts as 'different enough'.
In the popular conception, Naha Okinawan is sort of seen as the one representative Ryuukyuuan language (not that anyone would use that term), and you might find on Yaeyama that locals appreciate you attempting to use anything Ryuukyuuan. That said, Naha Okinawan is very different from everything used in the Yaeyama archipelago, and if you want to learn about the Yaeyama language(s), you should look it up separately.
(Scholarly source, for those interested. Compare the descriptions of the different languages/dialects from Amami and from Miyako for a sense of how the five-language classification is probably insufficient.)