If you read the next few lines in the gemara Bava Batra 15b, you will see that the premise of the question is incorrect. The gemara clarifies that these seven listed are not gentile prophets, but rather prophets to the gentiles. Thus, possibly Iyov, included in the list, and certainly Elihu ben Barachel, included in the list, are Jewish, but prophesied to the nations of the world. Which is in fact what you quoted above from the gemara in your question:
Seven prophets prophesied to the nations of the world
without mention that they were gentiles. Here is what the ensuing gemara clarifies:
וליטעמיך אליהוא בן ברכאל לאו מישראל הוה והא כתיב ממשפחת רם
that is,
He said to him: And according to your reasoning that Job could not have been Jewish because he prophesied to the nations of the world, was Elihu ben Barachel not a Jew? Is it not written: “Of the family of Ram” (Job 32:2), meaning Abraham?
and continues:
אלא אינבוי אינבי לאומות העולם ה"נ איוב אינבוי אינבי [לאומות העולם] אטו כולהו נביאי מי לא אינבוי לאומות העולם התם עיקר נביאותייהו לישראל הכא עיקר נביאותייהו לאומות העולם
that is,
Rather, one must explain that Elihu is included in this list because he prophesied to the nations of the world; and so too it may be maintained that Job is included in this list, even though he is Jewish, because he prophesied to the nations of the world. The Gemara asks: But did not all the other prophets also prophesy to the nations of the world? Why then are only these seven mentioned? The Gemara answers: There, with regard to the other prophets, their main prophecies were directed to Israel, whereas here, with regard to these seven prophets, their main prophecies were directed to the nations of the world.