Beat someone to the punch
Do or say something just before someone else does. This figurative usage dates from the 1920s and derives from boxing where an expert boxer tends to deliver the first punch.