pip (someone) at the post
To defeat or succeed over someone by a very narrow margin or at the final, crucial moment, especially in a race, competition, or athletic event. Primarily heard in UK, Australia, Ireland. The favoured runner held the lead for the majority of the race, but a relatively unknown competitor pipped him at the post in the final 100 metres. It appears the young candidate is set to pip his competitor at the post for his seat in parliament, which would make him the youngest candidate from this constituency to do so in nearly 60 years.
pip someone at the post
or pip someone to the post
BRITISHIf you pip someone at the post or pip them to the post, you just beat them in a competition or race to achieve something. Note: The following expressions refer to the finishing post in a horse race. She applied for a job at the university, but she got pipped at the post by a man with more publications to his name. He was pipped at the post for BAFTA's best Actor award by Robert Downey Jr.
pip someone at (or to) the post
defeat someone at the last moment. Pip was an informal late 19th-century term for ‘defeat’, but it is uncertain from which sense of the noun pip it derives. Post here is the winning post in a race.