The idiom meaning so close that the lead between competitors is indeterminable is neck and neck. It is often incorrectly written neck in neck.
Although some usage authorities recommend always hyphenating neck-and-neck, we can treat this idiom like a typical phrasal adjective: hyphenate neck and neck when it precedes the noun or phrase it modifies (e.g., a neck-and-neck race), and leave it unhyphenated when it functions as a predicate adjective (e.g., the race was neck and neck). When it functions as an adverb (e.g., they ran neck-and-neck), it can go either way.
It was a suspenseful, neck-and-neck race to the finish line. [San Francisco Chronicle]
By the time the official campaign started, Labour and the SNP were neck and neck. [Guardian]
Even the Liberal and Conservative candidates say they are running neck and neck. [Canada.com]
He scored eight straight points in the second half to help Butler break out of a neck-and-neck game with the Rams. [Chicago Tribune]