Drive 5v relay with 2N2222

Yes but, I’m confused now.

Is the inverter/charger 12v ?

If so, use 12v, not 5v.