I think that's something that's considered to be fairly subjective. I think it's a ratio between borrowed ideas and new ones to an extent, though what specifically is being borrowed might also play a factor. I met a composer who joked that composing is the art of "stealing without looking like you're stealing," in the sense that you use ideas that you like, but in a way where people cannot immediately tell that you're borrowing.
Even the earliest of western music often borrowed older melodies though, with the earliest polyphony pretty much always being settings of Gregorian Chant. People also ended up borrowing works that borrowed off of the chants, and then those works were borrowed, and so on. Granted, there is plenty of material that was not completely based off of older works, but this concept of borrowing has been a pretty significant practice for a long time.
I don't know where I really stand on this, but I do feel that effort and the incorporation of enough new ideas to expand on the old makes a work feel less derivative.