I was trying to install a dash cam at the back, but it wouldn't turn off even when the car is completely off. Is there a way for me to change that so it will only turn on when acc or engine is on?
I'm pretty sure it's on all the time by design. Depending upon what year your CX-5 there might be a menu option to change it's behavior, but I may be imagining that...
As far as I know, it is always on, same as the center console box power outlet. The only outlet that turns on and off is the one under the Fan/AC control. You could try wiring it into a fuse box, but that's a lot more work.
Interestingly the rear power outlet turns on and off with the ignition as do the rest. I know this because I use a plug in tyre inflator. It is the UK model manufactured 30 September 2013. It looks like the US versions are different?