Wales’ Capital Region trailed 17-7 at the break with the hosts scoring three tries to their one through Rey Lee-Lo.
But they dominated following the interval with Cam Dolan and Garyn Smith crashing over the whitewash.
The victory, the 11th of the PRO12 season, ensured Cardiff Blues leapt above both their Scottish opponents and the Ospreys in the final standings, following the Swansea-based region’s heavy loss to Ulster.
Cardiff Blues were boosted by the return of Lloyd Williams and Tom James for the trip to Murrayfield but they could do little to help in a sluggish start.
Alarm bells were ringing after Jason Tovey put Rory Sutherland through a hole with an inside ball but Gethin Jenkins saved the day with a last gasp ankle tap.
Edinburgh maintained possession and moved the ball right but they were turned over in the corner.
The Blues should have cleared but they were then stripped of the ball themselves and it looked as though Tovey, who spent a season at BT Sport Arms Park, squeezed over but the effort was ruled out by the TMO.
They continued to press in the following minutes but were unable to turn their early pressure into points and Cardiff Blues worked their way into the encounter with some clever offloading.
After kicking to the corner and going through the phases with a succession pick and drives, Edinburgh took the lead. They switched back to the short side and a delicate offload from Cornell du Preez released Watson for the try.
Tovey struck the uprights with the conversion but he made no mistake three minutes later when he converted Matt Scott’s close-range try.
Wales’ Capital Region had their first opportunity to put points on the board shortly before the hour mark but Anscombe dinked the ball into the corner.
Edinburgh held the initial lineout drive but Cardiff Blues stretched their defence with impressive ball retention.
And after the ball was moved left Ellis Jenkins released Lee-Lo with a flick and the centre skipped past several defenders.
Anscombe converted from out wide to cut the deficit to five points and they went to the corner again soon after but the lineout was overthrown.
A counterattack from Edinburgh put the Blues on the back foot and they were punished for their failure to clear when the hosts claimed their third try.
Danny Wilson’s side attempted to play their way out of their own 22 but were turned over and an intelligent kick through did the damage with Tom Brown pouncing to score.
Tovey hit the right post with the conversion but the try had given Edinburgh a 17-7 lead at the interval.
Cardiff Blues started the second-half well and dominated the early territory and possession but were unable to make it count. They kicked two penalties to the corner but were held at bay and then turned over on both occasions.
But they spent the entire third quarter camped in the Edinburgh half and the Blues eventually turned their pressure into points when Dolan powered over.
It looked as though the opportunity had been lost after the ball came loose at the back of a maul but quick hands and a series of offloads made yards and saw the American lock crash over.
Anscombe added the extras and he was back at the tee five minutes later as Cardiff Blues took the lead.
A scintillating break from Dan Fish laid the platform for the try, he dummied to the right and just about released the ball to his left, finding Smith on the bounce to score.
Anscombe was once again on target as he stretched the visitors’ lead to 21-17 and they closed out the game to finish the season on a high.
Cardiff Blues: 15 Dan Fish, 14 Aled Summerhill (G Evans 40), 13 Garyn Smith, 12 Rey Lee-Lo, 11 Tom James (J Evans 42-48), 10 Gareth Anscombe, 9 Lloyd Williams; 1 Gethin Jenkins (c), 2 Matthew Rees (G Dacey 46), 3 Taufa'ao Filise (S Andrews 56), 4 Cam Dolan (M Cooke 73), 5 James Down (L Reed 71), 6 Josh Turnbull, 7 Ellis Jenkins, 8 Josh Navidi
Replacements: 16 Kristian Dacey, 17 Brad Thyer, 18 Scott Andrews, 19 Lou Reed, 20 Macauley Cook, 21 Tomos Williams, 22 Jarrod Evans, 23 Gavin Evans
5-0: Try (H Watson, 16)
12-0: Try (M Scott, 19), Con (J Tovey, 20)
12-7: Try (R Lee-Lo, 31), Con (G Anscombe, 32)
17-7: Try (T Brown, 38)
17-14: Try (C Dolan, 62), Con (G Anscombe, 63)
17-21: Try (G Smith, 67), Con (G Anscombe, 68)