Copyright and cameo
There is an unwritten rule about fame. As soon as you achieve success then someone, somewhere, will try to take the credit. For authors, this is usually in the form of a claim of plagiarism. The authors of The Holy Blood and the The Holy Grail claimed that The Da Vinci Code copied their research, and unsuccessfully attempted to sue Dan Brown. Stephanie Meyer faced an accusation that much of Breaking Dawn was based on another work, The Nocturne, an accusation that was dismissed by the courts last year. Recently, JK Rowling has had to defend herself from claims that elements of her Harry Potter books were lifted from another book, The Adventures of Willy the Wizard.
It’s a risk in the creative professions. Obviously, deliberately passing off someone else’s work as your own is a very bad thing. But ideas cannot be copyrighted, and so independently having similar ideas to other authors (as was the case with Meyer and Rowling) is common. In these cases the market will decide which interpretation of an idea it prefers, and so success or failure follow.
So far, so simple for complete works. But what about characters? Just as books are copyright, so are the characters within them (so long as they are the creation of the author). And so you cannot just take another author’s characters and use them in your own work without permission.
[PROVISO: Fan fiction, whilst strictly speaking a breach of copyright, is generally tolerated as it is not in direct competition with the original source work, and rarely damages the interests of the author, indeed as an expression of the fans’ appreciation of the original work it is often looked upon with a mixture of fondness, bemusement and good humour.]
But implied or referential appearances of other characters is common in fiction. For example, in A Study in Scarlet, Arthur Conan Doyle has Sherlock Holmes mention C. Auguste Dupin, Egard Allan Poe’s detective who was an influence on Doyle’s creation. More recently, Eastman & Laird’s Teenage Mutant Ninja Turtles contains an oblique reference to the comic book hero Daredevil. The origin of the Ninja Turtles is that a truck transporting chemicals swerves to avoid hitting a pedestrian, who is pushed out of the way by a young boy. Some of the chemicals fall off the truck and wind up leaking into the sewers. In the Daredevil comics, a young Matt Murdock pushes a man out of the way of an out of control truck that almost hits him. Some chemicals spill off of the truck, splashing Matt Murdock and blinding him (but providing him with superpowers).
What is the legality in those situations? Clearly the copyrighted works of another person are being used, either explicitly or by inference.
It all comes down to whether your use of the character can be classed as “fair dealing” (or in the US, “fair use”). This is a fairly restrictive doctrine: in some countries, like Australia, there are rigidly defined categories (the only relevant one I can see would be “parody and satire”, or possibly “review and criticism”). In other jurisdictions, like Canada and the US, the courts will use a discretionary test based upon guiding factors laid out in the relevant statutes and case law. Interestingly, in the United Kingdom incidental inclusion of copyrighted material in another work, whilst not strictly fair dealing, is not an infringement of copyright.
I would say that in the overwhelming majority of cases, incidental use can’t really come under fair use or fair dealing. Where such crossovers occur, the use is usually so fleeting, and irrelevant to the overall story, that whilst technically a breach of copyright it is tolerated in much the same way that fan fiction is.
For authors just starting out, my advice would be don’t do it. Not even an incidental mention. And if you must do it, be generous and respectful of the source work, and hope that the copyright holder has a good sense of humour…