If two non-Catholics were married only by a Justice of the Peace is it still recognized as a valid marriage by the Catholic Church? If so, would they then need an annulment to marry a Catholic? I can’t find anything specifically regarding civil unions like this for non-Catholics.
Yes, they would need an annulment. It is properly given consent that makes a marriage valid.
Only Catholics are required to be married in the Catholic Church. Non-Catholics are free to exchange vows anywhere and therefore 2 non-Catholics married before a Justice of the Peace would be a valid marriage.