expression, noun
Poetic and archaic term used to refer to one's lord or master, often in classical literature or waka poetry.
我が君の御前にて、かく申し上げる。
I humbly speak thus before my lord.
expression, pronoun
Poetic, familiar, and polite term of address used toward a beloved or respected person, often in classical or literary contexts.
我が君、いかがお過ごしですか。
My dear, how are you faring?
主君 is a more standard, less poetic term for one's lord or master.
あなた is the modern polite 'you', while 我が君 is archaic and poetic.
From 我が (my) + 君 (lord, you). The exact historical derivation is uncertain, but it is a classical poetic expression.