Traditionally referred to nōscō (“I know”), thus "a means of recognition" (cf. nōtiō, nōtitia), with perhaps the same short o of agnitus, cognitus.
This etymology has been disputed, for instance by De Vaan, who says that there is no credible etymology for the word.