The Welsh side were leading 19-15 ahead after a spectacular solo try by replacement wing Kate Thicker and looked to have sealed another victory before Edinburgh clinched a famous 20-19 win when prop Panashe Muzambe crashed over for the winning try.
Impressive scrum half Sian Jones, once again, was at the heart this performance by Lightning and crossed for two tries, along with Thicker’s superb solo try from deep within her own half put the Welsh side ahead.
Lightning were without four frontline players, with full back Nel Metcalfe, wing Catherine Richards and backrowers Gwennan Hopkins and Kate Williams called away by English champions Gloucester-Hartpury.
A trademark hit by Jones and a half-break by Jenna De Vera and tackle by full back Rhodd Parry holding up wing Cieron Bell up over the line marked a blistering opening 10 minutes between second and third in the table.
But it was the visitors who scored the first try when hooker Millie Whitehouse crashed over from short-range from a driving lineout to make the score 5-0 after quarter of an hour.
Wing Bell then finally broke the home side’s defence when she crashed in at the corner after a period of sustained pressure by the visitors. The Lightning then struck with a try of their by Jones after a break by Tess Evans off the back of a scrum.
Wilkins added the conversion before prop Poppy Fletcher stretched Edinburgh’s lead with a try just before the break to make the score 15-7 to the Scots at half-time.
After the break, Jones scored a typical poachers try from short-range after a lineout to haul the Lightning to back within three points of Edinburgh.
Before replacement wing Katie Thicker scored the game from deep inside her own half, shrugging off tacklers to give the Lightning the lead for the first time. Fly half Wilkins added the conversion before the Scots stole the win at the death with a late try.
Brython Thunder came off second best in a physical encounter against Celtic Challenge leaders, Wolfhounds, losing 41-10 at the Kingspan Stadium in Belfast on Saturday night.
The Welsh side were disrupted by four significant injuries during the game and battled to find consistency with so many changes against an impressive Wolfounds outfit playing on home soil.
The Thunder played into a strong wind in the first half and struggled to get a foothold in the game but did withstand 20 minutes of pressure before their defence finally cracked when Wolfhounds Number 8 Brittany Hogan crashed over from a 5m scrum to give the home side a 7-0 lead.
The visitors lost fly half Niamh Terry to an injury when she was stretchered off after the try but the Thunder responded with some impressive phase play with John and Wakely leading from the front and taking the game to their opponents.
Thunder the crossed from a driving lineout from short-range when prop Chloe Thomas Bradley crashed over the make the score 7-5 after half an hour.
Wolfhounds extended their lead with a try by hooker Sarah Delaney, converted by Nikki Caughey, and another try by wing Katie Corrigan to make it 17-05 at half-time.
After the break, Wolfhounds extended their lead with Corrigan crossing for her second try in the corner to give the home side a 17-point lead.
Corrigan crossed for two more tries, with Niamh Marley crossing for a try before Thunder crossed for a consolation try by Sioned Harries.