The Manchester City midfielder instigated the move which saw Abi Harrison head home a 93rd minute equaliser to salvage a 1-1 draw for the hosts at Hampden Park.
Ukraine led from the 22nd minute, when Roksolana Kravchuk slotted past Lee Alexander, but allowed three points to slip from their grasp when they failed to deal with Weir’s hopeful ball forward.
Their attempt to clear went only as far as Lana McLelland, who delivered a teasing cross for Harrison to convert at the near post with the last attack of the game.
The equaliser rewarded 45-minutes of second half pressure, as Scotland tried to make amends for a slow start which was punished when Kravchuk latched onto a defence-splitting pass and calmly applied the finishing touch after Weir was dispossessed in midfield.
City’s No.19 was denied what would have been a superb equaliser when Ukraine goalkeeper Daryna Bondarchuk tipped her 20-yard drive onto the crossbar, whilst Rachel Corsie had a penalty appeal waved away by the referee.
Harrison also sent a header on the roof of the net as Pedro Martínez Losa’s side poured forward in search of a leveller, but the Bristol City striker made no mistake in the dying seconds as she darted in front of her defender to glance McLelland's cross past Bondarchuk.
The draw sees Scotland remain in second place in Group B, two points behind leaders Spain and with a six-point cushion over Ukraine, who have a game in hand.