The halachic sources say that one needs to see the flame, but it's worth pointing out that it's not a blessing of enjoyment on seeing something, but rather an appreciation of the creation of fire. That's why it's only properly said on Motzaei Shabbat. There's a source in Pirkei d'Rabbi Eliezer, not brought down in halacha, that disconnects the blessing from flames, and possibly also from seeing.
ואם אין לו אש פושט ידו לאור הכוכבים, שהן של אש, ויסתכל בצפרניו שהן לבנות
מן הגוף, ואומר ברוך מאורי האש. ואם נתקדרו השמים, תולה אבן מן הארץ ומבדיל
ואומר ברוך המבדיל בין קודש לחול.
[If he be on a journey,] he puts forth his hand to the light of the
stars, which are also fire, and says: Blessed art Thou, O Lord our
God, King of the universe, who creates the various flames of fire. If
the heavens be darkened, he lifts up a stone outside, and says:
Blessed [art Thou, O Lord our God,] who separates between the sacred and the
profane.