Catalysis of the transfer of an acyl group to a nitrogen atom on the acceptor molecule. [ GOC:ai ]