There are indeed a few things in the song itself that seem to refer directly to the Gauss-Lobachevsky-Bolyai affair. Let me first summarise the actual history for those who have not heard it.
János Bolyai and Nikolai Ivanovich Lobachevsky (Hoi!) both independently discovered hyperbolic geometry at around the same time. Lobachevsky first reported his discoveries in 1826 and was the first to publish, which he did so fully in 1830. Bolyai's work was published as a short exposition in a textbook by his father, Farkas Bolyai, himself a mathematician (and student of Carl Friedrich Gauss), in 1832. Bolyai had worked on finding a consistent geometry which did not fulfill the Euclid parallel postulate doggedy between 1820 and 1832, and some 20 000 pages of notes and manuscripts survive. The proof of the independence of the parallel postulate had become an all-consuming obsession for him.
Thus Bolyai and Lobachevsky worked on the same problem at exactly the same time, and Lobachevsky published first. There is no question of independence and no question that both were utterly unaware of the other as they worked. Any idea of historical, actual plagiarism here is absurd.
On reading Bolyai's exposition in Farkas Bolyai's textbook, Gauss claimed that he had had these ideas first yet never published them. He recognised Bolyai's genrefused to take his former student's son on as a student in Göttingen.
So now to the parallels in the song:
Gauss metaphorically cried "Plagarise!" (not really, but he was clearly peeved) at Bolyai's work.
Bolyai was clearly disheartened on learning that Lobachevsky had published two years before him: "My name in Dnepropetrovsk is cursed, when he finds out I published first!" (actually it was Kolozsvár, not Dnepropetrovsk, where "his name is cursed" - by Bolyai and also in Göttingen by Gauss);
The long chain of messengers stealing work in Lehrer's song seems to parallel the distance between Kolozsvár where Bolyai worked, the provincial Russian city of Kazan where Lobachevsky worked and Göttingen where Gauss worked. The words "I have a friend in Minsk, who has a friend in Pinsk, whose friend in Omsk has friend in Tomsk with friend in Akmolinsk, whose friend in Alexandrovsk has friend in Petropavlovsk whose friend somehow is solving now problem in Dnepropetrovsk!"- the absurdity of a network of scores spies running between towns separated by thousands of kilometres perhaps reflects the absurdity of the idea that Lobachevsky plagiarised Bolyai's work in the 1820s.
As noted already, Lehrer states he chose the name Lobachevsky wholly for prosodic i.e. meter in song reason. Lehrer has (he's still around) a particular genius for meter, and it is clearly a foremost consideration for him - listen to the "Elements" song, for example, to understand this. For me he's almost equal to Theodor Geisel (Dr. Seuss) or Chaucer in some of the Canterbury Tales (sorry William Shakespeare - I know everyone raves about meter in your works but I'm afraid no one's ever taught me them properly, so I don't get the meter).