Dragons failed in their bid for a possible Heineken Champions Cup place despite beating Edinburgh 24-17 in their final Pro14 game.
They needed a 45-point winning margin to overtake Glasgow in fourth place in Conference A.
Two tries from Matthew Screech and one from Jonah Holmes kept home hopes alive with a 24-5 lead at half-time.
But Charlie Shiel and Blair Kinghorn crossed in Edinburgh's comeback to add to Mesu Kunavula's first-half score.
The visitors ended the second half pressing strongly, but could not quite grab the draw with both sides left to play second-tier European rugby next season as Glasgow remained a point ahead of Dragons.
Next weekend Dragons face Northampton Saints in the European Challenge Cup quarter-finals while Edinburgh make the tough trip to Paris to take on Racing 92 in the Champions Cup.
Dragons started purposefully with lock Screech crashing over from a line-out driving maul and then galloping clear to score a second from Ashton Hewitt's break and Sam Davies' offload.
With fly-half Davies adding two conversions and a penalty, Dragons were 17 points up in as many minutes before visiting number eight Kunavula muscled over from close range.
Edinburgh had to reshuffle after the loss of Scotland fly-half Jaco van der Walt after 28 minutes, with Blair Kinghorn moving up from full-back.
Holmes added the third home try after 33 minutes on the overlap from a long Davies pass and Hewitt looked to have sealed the bonus point just before the break as he finished off a brilliant 90-metre move, only to be recalled for a foot in touch.
The interval provided a sharp turn in momentum as Edinburgh came out far more strongly after the break and replacement scrum-half Shiel shot over from a quick tap penalty from 40 metres out to get the scoreboard moving again after 65 minutes.
Kinghorn rattled the simple conversion against a post, but ran in for a try himself three minutes later and added the conversion, set up by a Chris Dean break.
The visitors almost grabbed a draw in the closing moments, but wing Eroni Sau was held up over the line and the Dragons held on for an improved league tally of six wins.
Lock Screech, who has been linked with a summer move to Cardiff Blues, was player of the match, while hooker Richard Hibbard may have broken a bone in his hand.
Dragons director of rugby Dean Ryan told BBC Sport Wales:
"The first half hour was probably some of our best stuff, then after half-time we started thinking about too many things and it gets more complicated especially as Edinburgh have nothing to lose.
"Ashton's disallowed try could have been the moment to kick on but we kept making errors and in the end, full credit to the team because we had to rescue the win which is different when you've been chasing points.
"I'm not that worried about that [improved number of league wins], but I'm pretty pleased with where we are after coronavirus, injuries and everything else.
"We've got a young group that's developing to be a bit more competitive at this level and we've got to keep building on that."
Edinburgh head coach Richard Cockerill:
"The effort to get back into the game was brilliant, but you never want to see losing as an outcome to be celebrated.
"But seeing where we were with injuries and struggling with the physicality in the first half, to step up our game and be going for a draw at the death was credit to the players, especially the young lads coming on for their first or second game. We can walk away with our heads held high.
"I'm sure Danny [Glasgow coach Danny Wilson] would have been doing cartwheels at half-time saying we needed to sort this out. We were not doing it for Glasgow, we were doing it for ourselves, but the table doesn't lie and they deserve their place.
"We can look forward to going to Paris now, and a game which will be our season. We are hoping to have all our Scotland players back on Tuesday and we will have a lot of work to get it right to shock Racing."
Dragons: Jordan Williams; Jonah Holmes, Aneurin Owen, Jack Dixon, Ashton Hewitt; Sam Davies, Gonzalo Bertranou; Brok Harris, Richard Hibbard, Lloyd Fairbrother, Joe Davies, Matthew Screech, Aaron Wainwright, Harrison Keddie (capt), Ross Moriarty.
Replacements: Elliot Dee, Greg Bateman, Leon Brown, Ben Carter, Ben Fry, Rhodri Williams, Evan Lloyd, Nick Tompkins.
Edinburgh: Blair Kinghorn; Jack Blain, Mark Bennett, Chris Dean, Eroni Sau; Jaco van der Walt, Henry Pyrgos; Murray McCallum, Sam Kitchen, Lee-Roy Atalifo, Marshall Sykes, Jamie Hodgson, Magnus Bradbury, Luke Crosbie, Mesu Kunavula.
Replacements: Patrick Harrison, Shaun Gunn, Angus Williams, Andries Ferreira, Connor Boyle, Charlie Shiel, Matt Currie, George Taylor.
Referee: Craig Evans (WRU)
Assistants: Ben Whitehouse, Adam Jones
TMO: Jon Mason