Andriy Boryachuk scored a scrappy effort from close range in the dying seconds of the first half, the BBC said.
Ukraine added another equally late in the second half when Viktor Kovalenko side-footed into the far corner.
It leaves Scotland fourth in their group halfway through the campaign, with seven points from a possible 15.
Read alsoShakhtar secure confident 3:1 win over Feyenoord in KharkivEngland, Netherlands and Ukraine are all faring better and Scotland's next game is away to Andorra in March.
It turned out to be a disappointing home double-header against Latvia and Ukraine as Scot Gemmill's men only mustered one point of their own, tempering the excitement of early campaign wins against Netherlands and Latvia.
The key chance for Scotland at McDiarmid Park came within the first few minutes – a great move involving Greg Taylor, Oliver McBurnie and Allan Campbell ended with Chris Cadden's low shot being saved by Andriy Lunin.
Lewis Morgan later had a low 20-yard strike parried but other than those chances the hosts struggled to create further clear-cut opportunities.
Ross McCrorie partnered captain Scott McKenna at centre-back and they looked in control until Ukraine pulled off an incisive counter-attacking move in added time at the end of the first half.
More than 1,000 fans, including some Ukrainian supporters, watched Scotland surrender possession far too cheaply as they tried to mount an attack of their own, and the visitors' cross in the box ricocheted and fell for Boryachuk to poke in.
The striker was profligate with a couple of second-half opportunities and the Ukrainian defence were alert to clear McKenna's header off the line with 10 minutes remaining.
McKenna nearly set up Scott Wright for a late leveller before Ukraine countered again and extended their lead through Kovalenko's composed finish.
Scotland Under-21s have not qualified for the European Championship since 1996, when a squad containing Allan Johnston, Charlie Miller, Jackie McNamara and Derek Stillie finished fourth in the tournament.