(Note: I am answering this question at the request of another user, made here.)
The "New" Perspective on Paul
The New Perspective on Paul is really a whole collection of overlapping and sometimes disparate viewpoints primarily within Protestantism, calling into question the traditional Protestant understanding of Paul's writings as teaching that justification is by faith alone and that good works do not contribute to justification and salvation but are only a result of justification and salvation.
This "new perspective" on Paul, therefore, is "new" only within Protestantism. Outside of Protestantism, Paul has long been read as teaching the necessity of good works as well as faith for justification and salvation. Catholic and Orthodox reactions to the New Perspective on Paul see many of these "new" understandings of Paul as dating back in Christianity all the way to the early church fathers.
The theological writings of Emanuel Swedenborg
However, my expertise is not in the early Christian fathers, but in the Christian theology of Emanuel Swedenborg (1688–1772). It was this perspective that I was asked to provide here.
Swedenborg came out of a strongly Lutheran background. His father, Jesper Swedberg, was an influential Swedish Lutheran clergyman. However, in Swedenborg's theological writings, composed in the later period of his life, he repudiated Lutheran and Protestant doctrine, along with some of the fundamental tenets of traditional Christianity as a whole, such as the Trinity of Persons in God.
In particular, Swedenborg utterly rejected the Protestant doctrine of justification by faith alone, regarding it as a major error on the part of its originator, Martin Luther. He saw that doctrine as based on "a single statement of Paul's, wrongly interpreted" (Apocalypse Revealed #892)—that statement being:
For we hold that a person is justified by faith apart from works prescribed by the law. (Romans 3:28)
The meaning of "the works of the Law"
Swedenborg's view of what this and related statements in Paul means when rightly interpreted bears a striking resemblance to a common viewpoint in the New Perspective on Paul, which is summarized in the above-linked Wikipedia article in this way:
In the historic Lutheran and Reformed perspective, known as sola fide, theologians understood Paul as arguing that Christians' good works would not factor into their salvation—only their faith would count. But according to the "new" perspective, Paul was questioning only observances such as circumcision, dietary laws, and Sabbath laws (these were the 'boundary markers' that set the Jews apart from the other nations), not good works in general.
Similarly, Swedenborg here expands on his statement that justification by faith alone is based on a single statement of Paul wrongly interpreted:
There are people who accept a faith separate from charity and who justify themselves by what Paul says to the Romans: "We are justified by faith apart from works of the Law" (Romans 3:28). They worship this statement like people who worship the sun; and they become like people who stare so constantly at the sun that their eyesight becomes dull and incapable of seeing things in normal light. They do not see what "works of the Law" means here—not the Ten Commandments, but the rituals described by Moses in his books, everywhere referred to as "the Law." To keep us from thinking that it means the Ten Commandments, Paul goes on to explain, "Then do we abolish the Law by faith? Far from it, we strengthen the Law" (Romans 3:31).
If we convince ourselves of faith alone on the basis of this statement, then by staring at this passage like the sun we blind ourselves to places where Paul lists the laws of faith and says that they are in fact deeds of charity. After all, what is faith apart from its laws? We blind ourselves to the places where he lists evil deeds, saying that people who do them cannot enter heaven.
We can see from this what blindness comes from a misunderstanding of this one passage. (Divine Providence #115, emphasis added)
Swedenborg sees the term "the Law" in the Bible as having several levels of meaning, as explained in another passage. (Note that "the Word" was the standard term for the Bible.)
The Word often mentions "the law." I will now say what that means in a narrow sense, in a broader sense, and in the broadest sense. In a narrow sense, "the law" means the Ten Commandments. In a broader sense, "the law" means the rules that Moses gave to the children of Israel. In the broadest sense, "the law" means the entire Word.
People know that in a narrow sense "the law" means the Ten Commandments.
In a broader sense, "the law" means the rules that Moses gave to the children of Israel. This becomes clear from the individual rules laid out in Exodus - they are called "the law:"
This is the law of the trespass offering. (Leviticus 7:1)
This is the law of the sacrifice of peace offerings. (Leviticus 7:11)
This is the law of the grain offering. (Leviticus 6:14 and following)
This is the law of the burnt offering, the grain offering, the sacrifices for sin and guilt, and the consecrations. (Leviticus 7:37)
This is the law of the animals and the birds. (Leviticus 11:46 and following)
This is the law for a woman who has given birth to a son or a daughter. (Leviticus 12:7)
This is the law of leprosy. (Leviticus 13:59; 14:2, 32, 54, 57)
This is the law for someone who has a discharge. (Leviticus 15:32)
This is the law of jealousy. (Numbers 5:29-30)
This is the law of the Nazirite. (Numbers 6:13, 21)
This is the law of cleansing. (Numbers 19:14)
This is the law of the red heifer. (Numbers 19:2)
[This is] the law for a king. (Deuteronomy 17:15-19)
In fact, the entire five books of Moses are called "the Law" (Deuteronomy 31:9, 11-12, 26). They are called this in the New Testament as well (Luke 2:22; 24:44; John 1:45; 7:22-23; 8:5; and elsewhere).
When Paul says, "We are justified by faith apart from the works of the Law" (Romans 3:28), by "the works of the Law" he means the rules just mentioned. This is clear from the words that follow this passage in Romans, as well as from Paul's words to Peter chiding him for making others follow Jewish religious practices. In the latter context, Paul says three times in one verse, "No one is justified by the works of the Law" (Galatians 2:14, 16).
In the broadest sense, "the law" means the entire Word. This is clear from the following passages: "Jesus said, 'Is it not written in your law, You are gods?'" (John 10:34, referring to something written in Psalms 82:6). "The crowd answered, 'We have heard from the law that Christ remains forever'" (John 12:34, referring to something written in Psalms 89:29; 110:4; and Daniel 7:14). "This was to fulfill the Word that was written in their law, 'They hated me for no reason'" (John 15:25, referring to something written in Psalms 35:19). "The Pharisees said, 'Do any of the rulers believe in him? But the crowd does, who do not know the law'" (John 7:48–49). "It is easier for heaven and earth to pass away than for the tip of one letter of the law to fall" (Luke 16:17). In these passages, "the law" means the entire Sacred Scripture. There are a thousand passages like this in [the Psalms of] David. (True Christianity #288, emphasis and links added)
Here Swedenborg states that when Paul says that we are saved by faith apart from the works of the Law, he is not referring to good works in general, such as are commanded in the Ten Commandments and elsewhere in the Bible, but rather that Paul is referring specifically to the Jewish ritual, ceremonial, and cultural law. In short, he is stating the same thing as proponents of the New Perspective on Paul who say that "Paul was questioning only observances such as circumcision, dietary laws, and Sabbath laws."
Here are two further, and somewhat briefer, statements by Swedenborg of the same principle:
Now since in Paul's saying (Romans 3:28) faith does not mean faith in God the Father, but in His Son, and 'the deeds prescribed by the law' do not there mean those prescribed by the Ten Commandments, but by the law of Moses given to the Jews (as is evident from the sequel to this passage, and also similar statements in the Epistle to the Galatians 2:14-15), the foundation stone of modern faith collapses, together with the shrine erected upon it, like a house subsiding into the ground until nothing is left showing but the top of the roof. (True Christianity #338, emphasis and link added)
And in one of his letters to Dr. Gabriel Beyer, an early receiver of Swedenborg's doctrines:
There are few in Sweden who admit the understanding into anything theological. Thus no enlightenment can be received in and from the Word of God, as for example Romans 3:28 and Galatians 2:16. There faith imputative of the merit of Christ is not meant, but the faith of Jesus which is faith from Jesus in Jesus; nor are the works of the law of the Decalogue meant, but the works of the Mosaic law which were for the Jews alone. (Letter to Beyer, October 30, 1769, emphasis and links added)
Conclusion
These quotes from the theological works of Emanuel Swedenborg show that in the mid to late 18th century, two centuries before even the earliest writers taken as modern antecedents to the New Perspective on Paul, Swedenborg clearly and repeatedly stated one of the key principles of the New Perspective on Paul: that when Paul referred to "the works of the Law," he did not mean good works in general, and certainly not the Ten Commandments, but rather the ritual, sacrificial, and cultural laws that were commanded in the Hebrew Bible to be observed by the Jewish people.
There are other ways in which Swedenborg anticipated the New Perspective on Paul, but covering them all would swell this answer beyond the size constraints of this platform.