The home side had taken an early lead in the Scottish capital when Greig Tonks danced in to score after six minutes.
But the lead lasted just four minutes before Rob Cook levelled for the visitors.
Thomas then touched down twice to give Nigel Davies side an 18-point lead before David Denton scored a converted try to give the scoreline a more respectable look for Edinburgh.
The victory moves Gloucester on to eight points in Pool 6, two behind leaders Munster, with Perpignan on six points and Edinburgh on four.
Alan Solomons' Gunners were dealt a blow before kick-off when hooker Ross Ford failed a fitness test and the Scotland international had to make way for Tongan understudy Aleki Lutui.
But that change did not slow the hosts down as they got off to a flying start.
Edinburgh worked quick ball from a ruck as flanker Cornell Du Preez and number eight Denton both drew their opposite numbers in before off-loading to Tonks to jink his way in to score in the corner.
There was no additional bonus, however, as Greig Laidlaw failed to add the conversion.
But before Edinburgh had even had time to settle into their lead, Gloucester levelled as Henry Trinder's kick in behind a flat home defence allowed Cook to run in for an easy score.
Fly-half Freddie Burns also missed his attempt at the extras but made up for it with a penalty soon after to put the Englishmen ahead.
Edinburgh were again caught out defending in a straight line after 19 minutes as Cook's clever reverse pass played in Thomas to gallop in for a second score, converted by Burns.
The home side were lucky not to see their numbers reduced to 14 when Jack Cuthbert escaped a yellow card despite his mid-air smash into the jumping Burns.
The collision did not affect the victim though, as Burns successfully added another penalty soon after.
Things went from bad to worse for the hosts five minutes into the second period when Gloucester skipper Billy Twelvetrees was allowed to dance 50 yards from his inside his own half and from one wing to the other before laying off to Thomas to dive over for his second try.
It was a mesmerising run but someone in the Edinburgh ranks should have stopped the England international before he came anywhere near the danger zone.
There was no additional pain, though, as Burns again missed the conversion.
That concession seemed to wake Edinburgh from their slumber and they finally gained territory before putting the visitors under pressure, which told when Denton barged his way in to score.
Laidlaw converted to reduce Gloucester's lead to 11 points, who were soon playing with reduced numbers as Thomas was sin-binned for his cynical off-side barge on the Edinburgh number nine as he led a breakaway.
The West Country outfit survived the 10-minute punishment without suffering further damage but could not grab the fourth try that would have gained them a bonus point.
The teams will meet again in the second leg of the Pool 6 double-header at Kingsholm next Sunday.