A superficial similarity does not an inspiration make.
I'm a Tolkien purist through and through. Babylon 5 shows huge
influence from Tolkien's legendarium and is undoubtedly its biggest influence. JMS' online comments consistently reference LOTR as a comparison and influence. Nagisa is right in that having the elder races leave the younger ones for the Grey Havens is a huge riff but there are countless others that are vital to the DNA of the show.
Some are obvious like the Rangers and Sinclair's Za'ha'dum fall and resurrection. Others are to do with the general structure of the novel-like story. And Sheridan/Delenn's romance is a clear homage to Beren and Luthien (My favourite chapter of Tolkien's!).
Indeed. The Foundation series and Lensman and the like are definitely influences (as is the work of Alfred Bester on the way he uses telepaths and I'm not even counting the reuse of Bester's name), but the Lord of the Rings is clearly one of the biggest and most important influences on the series. The only influence? No. Is it a 1-to-1 comparison? No. But to similarly dismiss it as a couple name lifts and Elric quoting Gandalf is heavily understating its influence too.