Remember when George Harrison was sued successfully by lawyers claiming that Harrison's My Sweet Lord was lifted from Sweet Talkin' Guy, a sixties hit from the Chiffons?
The judge found against Harrison, not plagiarising deliberately is no defence in law.
Cue the shift of multi-million dollar royalty payments from one account to the other, and the Sweet Talkin' Guy writers became very very rich overnight, with all subsequent payments for both songs' airplay going to them.