first of all it is important to be aware that the residence requirement does not say that you must have stayed in Denmark (or EU, if you are an EU-citizen) for the last 5 years. The requirement is that you (in 2019) have stayed at least 5 out of the last 12 years in Denmark (or EU, if you are an EU-citizen).
The extra wage insurance ("Lønsikring") offered by the different A-kasser, is only for regular A-kasse members that already pay for the "normal/basic" unemployment insurance.
Payments from Lønsikring follows the unemployment benefit rules. That is, if you are not entitled to unemployment benefit ("dagpenge"), for example because of the residence requirement, then you are also not entitled to money from "Lønsikring".
So in your case it will give no meaning to buy Lønsikring through an A-kasse.
However there is one out of the 24 A-kasser which also offers Lønsikring as a normal private insurance (not following the unemployment rules) to non A-kasse members. This is A-kassen Frie. Read more about "Fri lønsikring" from Frie. To be able to buy this Fri Lønsikring you don't need to be member of their A-kasse, however you must be member of their Union - which cost DKK 65 per month.
You can also buy lønsikring through many of the normal insurance companies, like for example TopDanmark.
Before you decide to buy Lønsikring that is not connected to A-kasse membership, we strongly recommend you to read terms and conditions for the insurance very carefully. Normaly the terms and conditions include several exceptions, where you will not be covered in case of unemployment.
I think we can say that the vast majority who have Lønsikring have bought it through their A-kasse, as a supplement to the normal/basis Unemployment insurance.
Anders Weber, www.a-kasser.dk