To make it “under the wire” means another instant and you’d have been too late.
Before modern electronics, stewards posted at the finish line determined the winners of horse races.
A reference wire was strung across the track above the finish line to help them see the order of finish, or which nose crossed the line first.
The result of a horse race was determined by the order in which the horses passed under the wire.