It is suggested that this expression derives from a very old children's game called dibstones. This game, played with sheep knuckle-bones or pebbles, dates back at least to the 17th century (well, that's when the name first pops up in the written). The object was to capture one's opponent's stones, and when a stone was captured, the victorious player would call "Dibbs!" with the meaning "I claim [the stone]". It soon came to be used outside the game but with a similar meaning, and there you have it. Interestingly, that usage outside of the game isn't recorded until 1932 in the US.