The 5V pin can only produce 5V if there is a 5V source connected to the board via the USB connector. There is no boost/step-up converter on these boards to provide 5V from the VBAT input.
If you want to run off battery and require a 5V supply for an external module or sensor, you’ll need to provide your own external boost converter. Something like the 5V Step-Up/Step-Down Voltage Regulator S7V7F5 from Pololu.