Your (broken) brass/bronze spike is what is known as a "maritime" or "marine" nail or spike. They were (and still are) made of metals which do not corrode like iron/steel will quickly do in a saltwater environment. They are used in the construction of boats and ships, and also docks and other "waterside" buildings. In olden times they had a square-sided shank, and were made of brass, bronze, or copper. In the 20th-century they had a typical cylindrical shank, and were more often made of stainless steel or silicon-bronze. To see photos of various types, do a websearch for "marine nails."
Brass/bronze/copper "Marine" nails/spikes date at least as far back as the Roman Empire, so dating them accurately can be difficult. That being said... your brass/bronze find's shank is square-sided, with a neatly-made circular head. Those characteristics tend to indicate it was made in the late 18th-century or early 20th-century. (On earlier ones, the head is a crudely made square or an irregular circle.)