"A work of man" is a key phrase, for if baptism is not a work of man since it is a effect of grace thru faith, then neither is anything done by grace thru faith.
Which leads into more theology, as since man did not earn any inherent ability, thus even having a brain is a result of unmerited grace, and by such some have faith that God will save them by their works, and claim they are saved by grace via the merit of their works of faith - by God's grace they earned eternal life.
Thus the need to differentiate btwn "common' and "salvific" grace, the latter by which the convert does what he otherwise would not and could not do, as God draws men to Himself, (Jn. 6:44; 12:32), opens hearts,. (Acts 16:14) and grants repentance faith. (Acts 11:18; Eph. 2:8,9)
However, salvation by grace does not exclude man from making a response, as if comatose conversions, but the response man makes does not earn him justification, but his faith is counted as that. Thanks be to God.
And as works by the Spirit are faith in action, then in protesting against inert faith as James does, it can be said a man is justified by his works, as meaning by a faith which effects works, but not as if the merit of his works themselves earned him acceptance into Heaven.
For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. (Ephesians 2:8-9)
Yet God rewards works, (Mt. 25:31-40; 1Cor. 3:8ff) in recognition of faith, (Heb. 10:35) as part of his covenant of grace, in which He promises to reward souls for the obedience of faith, who actually deserve eternal damnation in justice.
That should have read, "Baptism is not a work of merit." I agree God enables man to respond to His offer of salvation by grace through faith.