From Old Portuguese conosco, cõnosco, connosco, from com (“with”) + Old Portuguese nosco (“with us”). Noscum is attested in the Appendix Probi as a 'vulgar' form of Latin nobiscum. Displaced Old Portuguese nosco.
Brazilian speakers who use this pronoun colloquially (instead of a gente) may not make the contraction and use com nós instead. This is highly proscribed but common. Portuguese speakers use connosco instead.