If there is enough space between the toilet and the wall, you can use a thin sponge stick or a mini roller to paint behind the toilet. If not, you may need to remove the toilet tank or bowl to access the wall.