Following an injury-hit first-half, which saw Josh Navidi and Owen Lane depart, the Blues trailed 20-6 following Gloucester tries from Henry Trinder and Mark Atkinson.
But Danny Wilson’s men fought back admirably straight from the restart with Tomos Williams and Garyn Smith scoring, and Jarrod Evans keeping the scoreboard ticking.
James Hanson's try regained the lead for the Cherry and Whites, but a stunning finale was in store.
Blaine Scully crossed in the corner before a last-gasp penalty from Anscombe sealed a win, to clinch the second Challenge Cup for Cardiff Blues.
Cardiff Blues made a flying start to the encounter with Gareth Anscombe unlocking the Cherry and Whites’ defence with an intelligent kick, which Willis Halaholo collected.
He beat one defender before losing the ball in contact but his side did not have to wait long for their first points with Josh Navidi claiming a penalty at the breakdown.
Jarrod Evans slotted the points but the Blues were dealt a blow on six minutes as the ever impressive Navidi was forced off with an arm injury.
Gloucester soon took advantage as they set up camp in the Blues 22 and used their sizable pack to make the hard yards.
The pressure eventually told as Billy Burns dinked a kick to the corner, with advantage, which Trinder collected to score.
Twelvetrees added the extras but Cardiff Blues responded impressively with Jarrod Evans pulling the strings to put players into space.
It almost paid dividends on 12 minutes when quick hands from Evans and Owen Lane but Rey Lee-Lo into space.
He released Blaine Scully, who appeared destined to score, and while he acrobatically grounded the ball, Gloucester scrum-half Callum Braley recovered remarkably well to drag the wings foot into touch.
Wilson’s side remained in the ascent and following further pressure they were awarded a penalty, with Evans on target to cut the deficit to a single point.
Twelvetrees added a further penalty for Gloucester on 25 minutes and the Blues soon lost another player as Lane suffered a hand injury.
It looked as though Gloucester had claimed a second try as Lewis Ludlow was released by a fine offload from Jason Hohneck but Jerome Garces ruled it marginally forward.
However, with half-time approaching the Cherry and Whites struck with a stunning second try from deep inside their half.
Atkinson and Twelvetrees combined to put Trinder on the inside and he found Braley in support. The scrum-half then performed a textbook switch to take Anscombe out of the defence and put Atkinson away.
Twelvetrees added the extras and slotted a controversial penalty on the stoke of half-time to make it 20-6 to the English outfit.
Wales’ Capital Region were left with a huge amount to do but they made the perfect start to the second half with a try inside one minute.
Gareth Anscombe dinked the ball through the English defence, collected and then did phenomenally well to chip inside again.
Tomos Williams displayed his electric pace and despite illegal contacts from Braley he managed to hack ahead twice, win the race and scoop the ball from his shoelaces for a sensational try.
Evans knocked over the conversion to breathe further life into the Blues and cut the deficit to just seven points.
The Blues continued to threaten, displaying a real zip and working further opportunities out wide, which they were unable to quite capitalise upon.
However, they were rewarded for the enterprise when Jake Polledri was penalised and Evans stepped up to nail his third penalty.
Minutes later they left Gloucester shell-shocked as they struck with a second try in quick succession.
After pulling the West Country from left to right they were undone as Evans threaded a kick through to the corner with the outside of his boot, with Smith collecting.
Evans was again on target but the rollercoaster nature of the encounter continued to swing as Gloucester rumbled over from a driving lineout, which Twelvetrees converted to regain the lead.
The England centre kept the scoreboard ticking but the Blues threw the kitchen sink at Gloucester in the final quarter.
With Anscombe now at 10 they hammered at the opposition with Matthew Morgan almost dazzling over.
However, the pressure finally told as Scully squeezed in at the corner to give his side hope.
With the restart secured, Anscombe found Smith with a stunning crossfield kick. The replacement hacked ahead and forced a penalty inside the Gloucester 22.
With huge pressure on his shoulders, Anscombe showed nerves of steel to slot the conversion and seal a dramatic victory in Bilbao.