Clarets beat Bournemouth to progress in Premier League Cup
The 18-year-old, who joined the club as a free agent from Stoke City earlier in the year, stayed alert to beat Callum Stanton in the 108th minute after the Cherries goalkeeper had saved his penalty.
The midfielder was the man that won the spot kick in the first place, though referee I. Johnston was forced to pull back play to consult with his assistant.
Stanton guessed correctly as Yao went low to the right hand side but the teenager got to the rebound first to rifle the ball home from close range.
Michael Jolley's side, fresh from winning the Final Third Development League Cup against the Potters, twice came from behind to take the tie in to an extended period though they dominated for considerable spells.
The visitors took the lead before the quarter-of-an-hour mark when Sam Matthews's deflected effort from Jordan Lee's cross was saved by Conor Mitchell but striker Sam Surridge pounced to tuck the ball inside the near post.
Burnley hit back in the 28th minute when Ntumba Massanka cushioned a clearance in to the path of Dwight McNeill and the winger's rasping left-footed drive from the edge of the box nestled in the corner.
However, the hosts barely had time to get back in to shape as Bournemouth regained the advantage within a minute. Mikael Ndjoli drove at centre back Jimmy Dunne before guiding a shot in to the corner.
That's how the scoreline remained at the interval but the Clarets responded well after the break. And they had their reward early on in the second half when full back Taofiq Olomowewe intercepted possession, played the ball in to Tinashe Chakwana and the forward finished well after turning his marker and beating Stanton with his right boot.
From that point the home side were in command as Chakwana, Brad Jackson and substitute RJ Pingling all went close but, with the tie heading towards a penalty shoot-out, Yao struck to seal a 3-2 win and send the Clarets through.