There are other parallels. In The Sandman, Shakespeare writes A Midsummer Night's Dream and The Tempest for Morpheus. Anderson wrote A Midsummer Tempest about a parallel Earth where Shakespeare was the Great Historian, not a great dramatist, thus his characters really existed. That novel features Anderson's inn between the worlds where characters from different universes and fictions meet, as in Gaiman's Inn of the Worlds' End.
Anderson imagines a Roman in the reign of Augustus who speculates that the Empire might either conquer the whole world or, as then current policy suggested, stay approximately as it was. Gaiman shows us Augustus formulating the latter policy and tells us why he did it.
Both quote James Elroy Flecker, including "...the Golden road to Samarkand." Anderson refers to and quotes Kipling. Gaiman described his Sandman story, "Hob's Leviathan," as "...me doing Kipling..." Kipling has an Indian Prime Minister who becomes a mendicant. "Hob's Leviathan" has an Indian king who becomes a mendicant.