Origin of the term "Going down to the wire"

Does anyone know when, where and how this originated? What is it referring to?

Horse racing. The wire is the finish wire.

This is a WAG, but I thought the string/ribbon/thin-flexible-material-stretched-across-the-track that marked the end of a race was called the “wire” and that any race that was decided by seeing which contestant broke through it was one that had come “down to the wire.”

Main Entry: down-to-the-wire
Pronunciation: 'daun-t&-[th]&-'wIr
Function: adjective
Date: 1952
: full of suspense; especially : unsettled until the very end

Horse racing was once more popular than football in North America.