Carlisle United winger Lewis Bell went up against some of Rangers' top young players in his latest loan outing.
But Bell and Gretna 2008 suffered an agonising late defeat in the Lowland League game.
They lost 2-1 to Rangers B thanks to a last-minute goal by the home side.
Bell was making the latest appearance of a loan spell with Michael McIndoe's side which was recently extended until the end of the season.
The 20-year-old played the full game at Dumbarton on Tuesday night.
Rangers B took the lead inside ten minutes when Robbie Ure scored from close range.
United first-year pro Bell came close to an equaliser on the hour but was denied by Gers keeper Jacob Pazikas.
Gretna then did level from the penalty spot through Lewis Turner.
READ MORE: Big following set to back Carlisle United at AFC Wimbledon
But the visitors conceded in the fifth minute of added time as Scotland Under-19 forward Ure dramatically snatched victory for Brian Gilmour's side.
"They [Gretna] had something to hold onto with that equalising goal, so it becomes a bit more difficult," Gilmour told Rangers TV.
"We kept going and worked an opportunity in the last minute of the game, but there were opportunities before that where we could have been more ruthless."
It sent Rangers B top of the table with Gretna in 16th.
Another of Carlisle's young loanees, striker Sam Fishburn, was an unused substitute as Morpeth Town claimed a 1-0 win at Whitby Town in Northern Premier League Premier Division.
Ben Sayer hit the winner for Morpeth against a home side who included former Carlisle striker Connor Simpson.
Morpeth moved up to 17th as Whitby slipped to 19th.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here