Apparently using only 1-2 names from another work would not be sufficient to cause a work to become derivative, but is there a maximum limit of how many names can be reused?
There are two areas of IP law that might apply here, copyright and trademark law. Of these, copyright law will be more significant and more likely to lead to a possible suit.
US Copyright Law
Use of Previously Used Names
Using the name of a character from an earlier work, even the name of a well known character that is central to the earlier work, does not of itself create copyright infringement. Even the use of a very well-known and distinctive name, such as "Harry Potter" or "Bilbo Baggins" or "Clark Kent" or "James Bond" would not, on its own create a case for infringement.
For one thing, names as such are not protected by US copyright at all. The US Copyright Office's Circular 33: "Works Not Protected by Copyright" reads (on pages 2-3):
Words and short phrases, such as names, titles, and slogans, are uncopyrightable because they contain an insufficient amount of authorship. The Office will not register individual words or brief combinations of words, even if the word or short phrase is novel, distinctive, or lends itself to a play on words. Examples of names, titles, or short phrases that do not contain a sufficient amount of creativity to support a claim in copyright include:
- The name of an individual (including pseudonyms, pen names, or stage names)
- The title or subtitle of a work, such as a book, a song, or a pictorial, graphic, or sculptural work
- The name of a business or organization
- The name of a band or performing group
- The name of a product or service
- A domain name or URL
- The name of a character
- Catchwords or catchphrases
- Mottos, slogans, or other short expression
No amount of use of the name or names of fictional characters from other, previously existing works constitutes a copyright infringement, unless there is a substantial similarity beyond the name itself.
The use of a character or characters copied from a previous work may make a new work a derivative of the older work. For this to occur, the character(s) must be presented in the newer work with several distinctive elements clearly copied from the older work. These might include the detailed description of the character, the character's turns of speech, the ways in which a character acts, or other elements of similarity. While re-use of the name of the character might contribute to this similarity, it is probably going to be the least important aspect of such a similarity.
in Nichols v. Universal Pictures Corp., 45 F.2d 119 (2d Cir. 1930) Judge Learned Hand explored the question of when a literary work (a play in this case) infringed another with similar plot elements. He wrote (emphasis mine):
It is of course essential to any protection of literary property, whether at common-law or under the statute, that the right cannot be limited literally to the text, else a plagiarist would escape by immaterial variations. That has never been the law, but, as soon as literal appropriation ceases to be the test, the whole matter is necessarily at large, so that, as was recently well said by a distinguished judge, the decisions cannot help much in a new case. Fendler v. Morosco, 253 N.Y. 281, 292, 171 N.E. 56.
When the question is whether the part so taken is "substantial," and therefore not a "fair use" of the copyrighted work; it is the same question as arises in the case of any other copyrighted work. Marks v. Feist, 290 F. 959 (C. C. A. 2); Emerson v. Davies, Fed. Cas. No. 4436, 3 Story, 768, 795-797. But when the plagiarist does not take out a block in situ, but an abstract of the whole, decision is more troublesome. Upon any work, and especially upon a play, a great number of patterns of increasing generality will fit equally well, as more and more of the incident is left out. The last may perhaps be no more than the most general statement of what the play is about, and at times might consist only of its title; but there is a point in this series of abstractions where they are no longer protected, since otherwise the playwright could prevent the use of his "ideas," to which, apart from their expression, his property is never extended. Holmes v. Hurst, 174 U.S. 82, 86, 19 S. Ct. 606, 43 L. Ed. 904; Guthrie v. Curlett, 36 F.(2d) 694 (C. C. A. 2). Nobody has ever been able to fix that boundary, and nobody ever can. In some cases the question has been treated as though it were analogous to lifting a portion out of the copyrighted work (Rees v. Melville, MacGillivray's Copyright Cases [1911-1916], 168); but the analogy is not a good one, because, though the skeleton is a part of the body, it pervades and supports the whole. In such cases we are rather concerned with the line between expression and what is expressed. As respects plays, the controversy chiefly centers upon the characters and sequence of incident, these being the substance.
Nor need we hold that the same may not be true as to the characters, quite independently of the "plot" proper, though, as far as we know, such a case has never arisen. If Twelfth Night were copyrighted, it is quite possible that a second comer might so closely imitate Sir Toby Belch or Malvolio as to infringe, but it would not be enough that for one of his characters he cast a riotous knight who kept wassail to the discomfort of the household, or a vain and foppish steward who became amorous of his mistress. These would be no more than Shakespeare's "ideas" in the play, as little capable of monopoly as Einstein's Doctrine of Relativity, or Darwin's theory of the Origin of Species. It follows that the less developed the characters, the less they can be copyrighted; that is the penalty an author must bear for marking them too indistinctly.
Thus only a detailed, distinctive portrayal of a character will constitute the kind of "substantial similarity" that leads to a judgement of copyright infringement. A name alone (or even several names) will not be enough to constitute infringement, even if the second author openly admits to taking the name from a previous work.
US Copyright Law includes a broad concept of fair use. Fair use is an exception to copyright, and so any use of an existing work that is held to be a fair use is not an infringement.
A work that is concernedly a derivative work may be a fair use. For example in Suntrust Bank v. Houghton Mifflin Co., 268 F.3d 1257 (11th Cir. 2001)the novel The Wind Done Gone (TWDG) was held to be a faior use of the earlier novel Gone With the Wind (GWTW). TWDG retells the story of GWTW from the point of view of he enslaved black characters. It repeats many scenes and incidents. But the court held that the use of these was "transformative" because of the way in which TWDG commented on GWTW, and was thus fair use.
Literary reference, the mention of, or allusion to, a previous work, is a common technique, and is usually considered to be a form of fair use. For example, in Mark Twain's "A Double-Barreled Detective Story" the character of Sherlock Holmes appears, but this was not considered a copyright infringement. In John Myers Meyers's novel Silverlock the title character and his companion Golias find and set off on Huck Finn's raft. In Randall Garrett's "The Ipswich Phile" there is a super-spy character named "Sir James le Lien". (A lien, as many readers of this site will know, is a form of secured debt not unlike a bond. The reference is clear.) Use of names from previous works as a form of literary reference will usually constitute fair use, as it did in all the cited examples.
US Trademark Law
Trademark law in the US protects a trademark against being used in commerce without permission. It is possible, although a bit unusual, for the name of a fictional character to be protected as a trademark.
There are, however, definite limits to the protections offered by trademark law. a protected mark is protected against use by another as a mark, that is a a designation of source, used to identify a brand, make, or type of goods or services offered or advertised for sale or rental. It does not protect agINST use of the mark as a name for the goods or services, not calimimng ownershipm of the mark (nominative use). And it does not protect against a use of the mark not in commerce, that is not used to identify any goods or services. Also, in most cases it does not protect against the use of the same mark form goods or servies of a quite different type, where no confusion is likely.
Use of a mark as the name of a fictional character within a literary work, not as part of the title of the work, and not in the advertising for that work, would not be "use in commerce" and so would not be trademark infringement, even if the name was protracted as a trademark.
Use of one or several names of character that had previously appeared in another litary work or works is not likely to constitute copyright or trademark infringement, unless detailed and distinctive aspects of the character, setting, or plot are also copied, or unless the name is used to identify or advertise the work.
There is no strong and precise criterion about what needs to be changed in copyright matters. If only because the importance of a name within a work is very hard to evaluate.
There are trademark-like collisions which are more obvious : for example, Harry Potter is not only the name of a character, it's also the name of a book series, so copying that name arguably wouldn't be the same as having someone named Weasley.
But the idea, I think, would be whether it can be reasonably believed that the name similarity is accidental. It doesn't seem to be the case in your question however since you seem to be copying names and asking at what point you may get caught. The short answer is, if you copy one name, and if I manage to prove it, then it's a copyright violation, plain and simple. Now, the amount of damages you'll be entitled to pay may be minimal, and that in turn may make the copyright holder deem it not worth the cost of suing, but in a boolean way, that is still illegal (unless you have the permission from the copyright holder, that is).