Weir, Scotland's Player of the Year, missed the first game against Hungary and the clash with Faroe Islands – both of which ended in victory - following a knee injury.
But she returned for the clash in Glasgow, winning her 80th cap in the process.
The City attacking midfielder almost set up former team-mate Jen Beattie on 36 minutes, whipping a corner in that Beattie headed goalwards only to be denied by a fine save by keeper Szocs.
Five minutes later Christy Grimshaw put Scotland ahead with a smart finish.
Lively and inventive as ever, Weir was a constant threat from set-pieces and particularly corners as the hosts chased a second goal, but it was Hungary who scored next as Vago levelled on 62 minutes.
Former City legend Beattie, plus ex-City team-mates Jane Ross and Claire Emslie ensured Weir was in good company at Hampden, where a record gate of 6,545 watched on.
But the Scots had to wait until the 90th-minute to secure a 2-1 win as skipper Rachel Corsie nodded in Beattie’s flick from a corner to secure three points.
Scotland now top Group B with a 100% record from their three games, three points ahead of who Spain have played one game less.
Scotland are in action again next Tuesday in a friendly against Sweden.
City return to domestic action with a mouth-watering Women’s FA Cup semi-final clash against Chelsea on Sunday 31 October.
It’s a 12:45pm kick-off at the Academy Stadium and tickets for all home games are now on sale.