Two goals in the final four minutes gave Hungary victory in a dull friendly encounter at Livingston's City Stadium.
Shaun Maloney put Scotland ahead from the penalty spot
The young Scots enjoyed the best of the first half and Shaun Maloney put them ahead from the penalty spot on 31 minutes, after a foul on John Kennedy.
Prior to the goal, Simon Lappin hit the crossbar with a fierce shot and Brian Prunty had a close range header saved.
Many substitutes were introduced in the second half and Tamas Csehi and Szoltan Jovanczai hit the late goals.
Despite the loss, Scotland coach Rainer Bonhof was not too downhearted.
"We played well for 60 or 70 minutes but if you make so many changes then that can happen," said Bonhof.
"I made the changes to get a better overview of the group but the rhythm was disrupted and we needed a couple of minutes to come back but it was too late."
Bonhof handed six starting players their first caps at this level: keeper Graeme Smith, Paul Lawson, Robbie Foy, Mark Wilson, Lappin and Prunty.
And despite a lack of familiarity the Scots were quick to settle and make all the early running.
Garry O'Connor's turn and cross from the left should have resulted in an early goal but Prunty's header from eight yards out was well saved by visiting keeper Marton Fulop.
Moments later Maloney curled a 20-yard free-kick just past the Hungary post and in the 13th minute Lappin lashed a 25-yard free-kick off the crossbar with Fulop struggling to reach as the ball rebounded clear.
Scotland continued to have the best of the play with Hungary keeping the ball well but threatening little.
In the 25th minute O'Connor flicked a close-range shot well over the crossbar after good work by Lappin down the left flank.
The young Scots took the lead with a penalty in the 31st minute after skipper Kennedy was fouled in the box by Vilmos Vanczak.
Hungary stunned the Scots with two late goals
Maloney stepped up confidently to send the goalkeeper the wrong way and the home side got the breakthrough their superiority deserved.
Bonhof made five changes to his side at the interval and, as a result, the game became disjointed and the quality of play deteriorated.
The pace of the game dropped markedly and it began to resemble a training session.
But with four minutes to go Hungary substitute Csehi netted from close range with the Scots defence missing.
And in injury time, fellow substitute Jovanczi netted a late winner for the visitors.
"In the last two or three months I've been following the Under-19s and trying to get a better picture of the younger lads," Bonhof continued.
"But now I've seen the boys in this match and I saw them in Portugal last December so step by step I'm selecting and judging and that's what's needed."
Scotland U21: Smith, Lawson, Lappin, Kennedy, Dowie, McCunnie, Foy, Wilson, O'Connor, Maloney, Prunty. Subs: Marshall, Dempster, Diamond, Morrison, Sweeney, Reilly, Beattie, Wallace.
Hungary U21: Fulop, Rodenbucher, Vasko, Vanczak, Takacs, Regedei, Ervin David, Huszti, Varga, Jozsi, Nogradi. Subs: Zoltan Kovacs, Jovanczai, Csopaki, Csehi, Belogh, Szijarpo, Sandor.
Referee: M Courtney (N Ireland)