Okay yeah that's way more philosophical than I was thinking. To me it's just neurons that fire and chemicals that are released in response to stimuli. That's the science part and the way we can iirc already recognize pain in brain scans. Or even just behavioral: you can observe how it alters its behavior depending on what the hurter does after hurting the animal. (Horrible as such a thing would be, it would still be science, even if we might choose not to use data obtained by extremely immoral research.)
If I were to try to answer, TheOtherHobbes came closest to my feelings about it and explained better than I could:
https://news.ycombinator.com/item?id=28425288