All of these answers respond to your question well, using scripture.
But because there is no reference to Protestantism in the NT, and because Catholics would take something different from scripture, I'd like to include the history of where the change took place between the Catholic church seeing seven sacraments (including confession) and Protestants not acknowledging those seven, cutting out confession. The origin of this difference can be traced all the way back to the Protestant Reformation. That may seem obvious to some and not to others. So instead of referring to the NT, I'm referring to the origins of Protestantism.
Origin of the word "sacrament"
In Greek, the origin of this word is "musterion" (Strong's 3466). This word has 28 occurrences in the New Testament. The NT Greek Lexicon defines "musterion" as: hidden thing, secret, mystery.
In Latin, in his "Apology," Tertullian uses the Latin word "sacramentum" instead of the Greek "musterion." As far as we know, there is no reference to the word prior to Tertullian so it's probably the case that he was the first to use "sacramentum" to denote "musterion."
In the 4th century, St. Augustine of Hippo defined "sacrament" as "an outward and visible sign of an inward and invisible grace." He also said: "The word is brought to the material element and it becomes a sacrament."
Origin of the establishment of 7 sacraments
Somewhere between 1100-1160 C.E., Peter Lombard (1096-1160) established seven sacraments.
From Pope Benedict XVI, in 2009. Full text: (pdf):
"Among the most important contributions offered by Peter Lombard to the history of theology, I would like to recall his treatise on the sacraments, of which he gave what I would call a definitive definition: "precisely what is a sign of God's grace and a visible form of invisible grace, in such a way that it bears its image and is its cause is called a sacrament in the proper sense... Peter the Lombard, moreover, explained that the sacraments alone objectively transmit divine grace and they are seven: Baptism, the Eucharist, Penance, the Unction of the sick, Orders and Matrimony."
Incidentally, it looks like the Pope left out one of the seven! That is: confirmation.
Meanwhile, during the time of Peter Lombard, according to the Ethereal Library at Christian Classics, another Peter -Peter Abaelard (1079-1142)- and Hugo de St. Victor (1096-1141) only named five sacraments. So we know from this, already, that there were controversies in how one would identify sacraments.
From: Ethereal Library. See commentary: (pdf)
"Abaelard had named five, —baptism, confirmation, the eucharist, marriage, and extreme unction. Hugo de St. Victor in his Summa also seems to recognize only five, —baptism, confirmation, eucharist, penance, and extreme unction,1613. Hugo divided the sacraments into three classes,—sacraments which are necessary to salvation, baptism and the eucharist, those which have a sanctifying effect such as holy water and the use of ashes on Ash Wednesday, and a third class which prepares for the other sacraments. He called the sprinkling with water a sacrament."
Protestant Reformation: Martin Luther Cuts the 7 Sacraments to 2
Martin Luther (1483-1546)
Source: Michael Vlach, at the Resource Library of Theological Studies, states:
"In Luther’s day the established church recognized seven sacraments that worked grace in the lives of those who received them... Luther said there were only two sacraments—baptism and the Lord’s Supper... In order for a sacrament to be efficacious in strengthening faith, faith must be present (Olson, 393). Thus, faith must be present for the sacrament to have any benefit. The sacraments do not work ex operaoperato—they do not work regardless of the faith of the person."
Source: Boise State University
"If it was clear what to do about the papacy, the matter of the sacraments was more difficult. Some, Luther rejected almost at once: the sacrament of ordination was out because by 1521 he was arguing that there should be no priests. Or, to be more accurate, he was arguing in favor of the notion of the priesthood of all believers. Everyone was a priest; any Christian could perform the rites of the faith, and beyond these no Christian held any special religious station. Extreme Unction was rejected out of hand because there was no foundation for it in Scripture. Penance was likewise rejected for like reasons. Luther retained confirmation as a rite, but denied that it was a sacrament. He held similar views on marriage: it was a part of life and even a part of Christian life, but it was not a sacrament. That left two: baptism and communion. Both these Luther did indeed view as sacramental, and on both there were bitter disputes among the reformers. Each deserves specific treatment regarding Luther's particular position.
Full commentary from Boise University: (pdf)
Martin Luther's thoughts about penance as a sacrament
From: "Martin Luther: Selections From His Writings." Martin Luther said:
"Though I lived as a monk without reproach, I felt that I was a sinner before God with an extremely disturbed conscience. I could not believe that He was placated [reconciled or appeased] by my satisfaction [going through the ritual of penance: contrition, confession, and acts of satisfaction]. I did not love, yes, I hated the righteous God who punishes sinners I was angry with God, and said, "As if, indeed, it is not enough, that miserable sinners, eternally lost through original sin, are crushed by the law without having God add pain to pain by the [New Testament] threatening us with His righteousness and wrath!" Thus did I rage with a fierce and troubled conscience."