While the characters in early episodes of Stargate SG-1 often referred to a group of mysterious aliens by using terms like "the gate-builders", I believe the first time those aliens were referred to as "the Ancients" was in S2E16 "The Fifth Race" in 1998. As far as I can tell, the first time the Ancients were brought up on Farscape was S1E16 "A Human Reaction" in 1999. Even if you assume the idea was planned from the very beginning of Farscape, the first episode still aired in 1999, months after the Ancients had been established in Stargate.
https://knowyourmeme.com/memes/mr-bean-cheating
meanwhile Babylon 5: "Am I a joke to you?" it predates both with the Ancients and gate technology.
"We're not some deep space franchise, this station is about something!"
Babylon 5 did have the First Ones, which was a way of categozing a few ancient advanced species who predate modern primitive species such as humans. Sometimes, members of this category were colloquially referred to as "ancient". Similarly, Stargate had the Alliance of Four Great Races, which was more or less the same thing. But the name of one of those species was literally "the Ancients".
In Babylon 5, the first ones weren't even the "first" ones. Loriens people were first. They sheparded the "first ones" into ascension and beyond.
Babylon 5 emphazied that the cycle of "born/survive/ascend/leave" was one that repeats, even if it takes millions/billions of years.
Lorien's species was just one of the several species that made up the First Ones. As I said, "First Ones" was essentially a way to logically categorize ancient races. There were multiple species who were considered part of the "First Ones". But yes, the first of the First was indeed Lorien.
I know that's how the wiki refers to him, but I'd disagree with that. Loriens people were old when the shadows/Vorlons first appeared as young races. That generation, and all the other associated races should be refereed to the "First ones," not the immortals.
It was Loriens people that raised them up, and it was Lorien that stayed behind to guide them, much as the shadows/vorlons stayed behind to guide us. That would put Loriens immortal race as a different, former generation before the apocryphal "First ones."
I would say that Babylon 5 and Stargate share the sense that "higher beings" turn into energy of some type. Loriens true form/vorlons/shadows phasing/Even the future humans the finale alludes to all turn into a state of energy that implies that is the next step of ascension, which slots right into Stargates take on it with the Ancients and Ori.