If, for example, k=1 then N is likely small. On the other hand if k=n then N is likely large.
The most computer-sciencey way is to look at n at which you get a repeat, ah! a hash collision.
One can make these ideas more quantitative under assumptions about the numbers of each types of marbles.
The math of hashing, birthday paradox, coupon collection and hyperloglog are good places to start.
Then there are other ways. Two of you count the number of typos in a tedious text. One says N the other says n and out of them only k are common. From this you can estimate the likely number of typos in the text.