Bilbo and GloinGlóin journey to the Lonely Mountain together in The Hobbit, and share in many adventures including battling a dragon.
Considering that Bilbo recounted his adventures to Frodo, and presumably Gimli also heard the same stories from GloinGlóin and the other dwarves that were on the same journey and lived in Erebor, they undoubtedly knew the names of everyone in Thorin's company.
Particularly as Gimli is often referred to as "son of Gloin" and Frodo has the same surname of "Baggins" as Bilbo, they would surely know of each other as the relations of the person who accompanied their father/uncle to the Lonely Mountain.
As they had their own journey together 60 years later, did they ever discuss the stories they knew of their father/uncle, and the fact that they knew each other well?