The problem you are asking is for multiclass classification of images.
For binary classification we use sigmoid activation function
For multiclass classification, as in your example where we need to classify dataset of 5 animals, we will use Softmax activation function.
The above code would now change to
Hope this helps