The original citation by Poincaré is from Science et Méthode (translated in English as Science and Method), chapter II “L'avenir des Mathématiques”.
Nous venons de voir, par un exemple, quelle est l’importance des mots en Mathématiques, mais j’en pourrais citer beaucoup d’autres. On ne saurait croire combien un mot bien choisi peut économiser de pensée, comme disait Mach. Je ne sais si je n’ai déjà dit quelque part que la Mathématique est l’art de donner le même nom à des choses différentes.
My translation:
We have just seen, through an example, how important words are in Mathematics, but I could cite many others. One can hardly believe how a well-chosen word can provide economy of thought, as Mach said. I do not recall whether I have already mentioned somewhere that Mathematics is the art of giving the same name to different things.
This confirms the citation by Poincaré. It is also strong evidence that this was not in response to another quote. Poincaré presents it as an original thought and formulation. In the previous sentence, he uses a concept formulated by another person, and he attributes it (Mach is Ernst Mach, mentioned earlier in the chapter). It would be uncharacteristic of him not to similarly attribute a source for the next sentence.
This, of course, does not guarantee that he didn't withhold a source of inspiration, either deliberately or through forgetfulness. Another piece of evidence is the lack of publications in French with the quote about poetry, or for that matter the tranposed quote in general (“X is the art of giving different names”). There are no hits on Google Books (or for that matter on Google Web) for “est l'art de donner des noms …” or “est l'art de nommer …”, which are the two plausible ways to start the sentence in French. While Poincaré may have read or heard it in a different language, given how much historiography there has been about him, it is implausible that there would be no translation of the original citation if one had ever been identified.