If I'm not mistaken, it's not "similar". It's literally the same word, just like the English "hound" and the German "hund". Meanings sometimes split, but the origin is the same.
It shares the same root, but it isn't the same word. "Negro" in spanish means the color black. It might or might not be used to refer to race, just like "black" might or might not be used to refer to race. To clarify, "black" usually translates as "negro". Meanwhile, "n-er" usually translates as "negro" followed by an offensive adjective.
I guess it apparently depends on what definition of the word "word" (which is quite overloaded) one uses, though. I'm not quite familiar with English linguistic terminology but I believe it's more about sharing a radix than a root.