Cardiff Blues ran in four ties to record a bonus-point win over Edinburgh in the Pro12.
Matt Scott's score gave the home side an advantage but Blues responded with Cory Allen and Filo Paulo crossing.
Dan Fish stretched Cardiff's lead early in the second half only for Tom Brown to go over for Edinburgh.
Dafydd Hewitt's try secured the additional point for the visitors and Cornell de Preez's late effort was not enough to prevent a home defeat.
The result reduces the gap between the sides to two points, with Edinburgh seventh and Cardiff ninth. And, with the Scottish side six points off Scarlets, their chances of a top-six finish and European qualification have been dented.
The match, played again at Boroughmuir's Meggetland while Murrayfield undergoes work to lay a new pitch, produced 20 points in as many minutes.
Blues' Gareth Davies and Edinburgh's Jack Cuthbert exchanged penalties before Scott received Harry Leonard to run in the opening try. Cuthbert converted.
Cardiff, for whom Gethin Jenkins made his 100th appearance, withdrew Lou Reed and introduced Bradley Davies and soon found themselves level. Kristian Dacey led a break that ended with Allen going over. Gareth Davies added the extras.
The visitors were forced into another change when Hewitt came on for Isaia Tuifua.
But they were soon ahead as Paulo plunged over following a line-out drive to set up another conversion for Gareth Davies.
The Welsh side started the second half positively and Fish touched down, Gareth Davies converting again.
However, Alan Solomons' side responded with Brown going over in the corner and Cuthbert continuing his run of successful kicks.
Allen's clever pass set up Hewitt to cross but, on this occasion, Gareth Davies' kick did not hit its mark before namesake Bradley was sin-binned for the closing minutes.
Du Preez delivered the game's seventh try and Cuthbert missed the conversion with the final kick of the game.
Edinburgh: Cuthbert, Hidalgo-Clyne, Scott, Strauss, Brown, Leonard, Hart, Dickinson, Ford, Nel, Gilchrist, van der Westhuizen, Coman, Du Preez, Denton.
Replacements: Bezuidenhout for Leonard (76), Kennedy for Hart (64), Atkins for van der Westhuizen (57), Grant for Denton (62). Not Used: Hilterbrand, Blaauw, Berghan, Beard.
Cardiff Blues: Fish, Cuthbert, Allen, Tuifua, Czekaj, G. Davies, Jones, G. Jenkins, Dacey, Filise, Reed, Paulo, Cook, J. Navidi, Copeland.
Replacements: Hewitt for Tuifua (29), L. Williams for Jones (70), Rees for Dacey (52), Andrews for Filise (57), B. Davies for Reed (13), E. Jenkins for J. Navidi (76). Not Used: T. Davies, Humberstone. Sin Bin: B. Davies (77).
Ref: Dudley Phillips (Ireland)