pip somebody at the post
From Longman Dictionary of Contemporary Englishpip somebody at the postpip somebody at the post informalWINto beat someone at the last moment in a race, competition etc, when they were expecting to win The Maclaren team were narrowly pipped at the post by Ferrari. → pip