The short answer is: of course not!
The slightly longer, and perhaps more accurate, answer is: not exactly but go and read James 2 and reflect upon Jesus words in John 8:31; 14:15, 23; Heb 10:26; and 1 John 3:9 (amongst other choice passages).
In a short article on the significance of baptism, RC Sproul puts it this way:
I personally do not believe that baptism is essential for salvation. If I believed that, I would think that the thief on the cross who was promised paradise with Jesus would have been disqualified because he obviously didn’t have an opportunity to get baptized. But I do believe that baptism is essential for obedience because Christ commands it. It’s just the same thing as when people say, “Do you have to go to church to go to heaven?” I would say, “Obviously not.” But do you have to go to church to obey Christ? Yes, you do. And if you are not inclined to obey Christ and have no inclination to follow His mandates, that may be a sign that you are not headed for heaven. So church involvement becomes a very serious matter of obedience.
So is obedience necessary for salvation? Not exactly. But if you are not inclined to obey Jesus and have no desire to follow his commands, it rather says something about your standing before him and whether the Spirit dwells in your heart.
The apostle John put it simply enough:
And by this we know that we have come to know him, if we keep his commandments.4 Whoever says “I know him” but does not keep his commandments is a liar, and the truth is not in him, 5 but whoever keeps his word, in him truly the love of God is perfected. By this we may know that we are in him: 6 whoever says he abides in him ought to walk in the same way in which he walked. (1 John 2:3-6)
It’s what Jesus says, ‘if you love me, you will keep my commandments’ (John 14:23). Those that love Jesus will want to keep his commandments; this infers that those who don’t want to keep his commandments don’t love him.
The thief on the cross, to whom Jesus promised paradise, had no time to be obedient. So obedience is clearly not required for salvation. Salvation is, indeed, by faith alone in Christ alone.
But those of us with the opportunity to be obedient, yet who choose to disobey and show no inclination or desire to obey, show ourselves not to be Heaven bound. That’s not because obedience is required for salvation but because a lack of obedience, or inclination to obey, suggests that the Holy Spirit has not changed our hearts and that we remain dead in our sin.
In other words, obedience is not necessary for salvation but unwillingness to obey most certainly means we aren’t saved.