Painkiller is more commonly used as explained above, but
I should mention that analgesic does not sound like anal because we pronounce anal or anus (the proper word for asshole) with a long a sound as in ape and analgesic with a short a sound as in apple. So, if you want to sound more scientific, go for it!