Practical part of the post:
George Alec Effinger wrote a story called White Hats that seems germaine to this discussion.
Effinger, George Alec, "White Hats"
Arthur and Audrey Trent are mugged on their way home from a Chinese restaurant in New Orleans. They report it to the police but the police do not expect to find the culprits. The next morning many heroes of the old radio and film serials begin showing up to help solve the crime (Klaatu and Gort make a small cameo appearance). After a weekend with the Trent house crowded with supporters or law and order the crime is finally solved by Lamont Cranston. The Lone Ranger rides off on Silver leaving Arthur Trent with a silver bullet.
Isaac Asimov's Science Fiction Magazine 8:4 April 1984 (pp.26-44)
That Old Funny Stuff: Author's Choice Monthly Issue 1, Pulphouse, October 1989 (pp.27-48)
from
here.
In an SF writing class taught by Mr. Effinger he described this story to us. After dealing with unhelpful police the narator wishes there were actual heroes in this world. Then Superman shows up at his house. Of course he is stunned and has him inside. Then the Green Lantern...The Lone Ranger, Spiderman, Dr. Strange. etc. until his house is full of these heroes and he's run out of drinks and dip and he wishes they would all leave. The above is based on my memory, and I have no idea if those were the actual heroes used in the story.
Part of the post where I like hearing myself think:
I remember a copyright lecture from college. The professor said that Disney is known as The Great White Shark in legal circles. And Peanuts sued a church for putting Snoopy in their bullitin even though the writer was a kid and obviously no one made money from it. Paramount has decided that the Star Trek fan fic helps build community and strengthens the brand, so the let it happen. Lucas feels that giving up control of his characters would damage the brand, so he does not allow it.
If your story is close enough to another idea that you are worried about copyright infringement, then I would say come up with a new idea. Of course nothing is stopping you from writing your own story for fun, and writing anything is better than writing nothing.