Alex Toolis crashed over deep into time added on to secure a bonus-point victory for Edinburgh at home to Pro12 strugglers Zebre.
A dismal first half yielded just three points from the boot of Jason Tovey.
Sam Hidalgo-Clyne came off the bench in the second period to set up the first of two Damien Hoyland tries.
And the replacement scrum-half darted through to score as the ill-disciplined visitors faded in the face of increased pressure from the hosts.
Edinburgh nudge ahead of Glasgow and Munster into fifth place, with those teams in action on Saturday.
If Alan Solomons’ side are to hang on to a top-six spot and earn a Champions Cup place, they will need to turn in more performances like the second-half showing at Murrayfield.
The error-strewn opening 40 minutes was simply appalling.
A strangely sluggish Edinburgh moved ahead on 13 minutes when Tovey, making his debut after a loan move from Dragons, knocked over a penalty following a high tackle on thundering prop WP Nel.
A ragged sequence of fumbles, stray passes and petty squabbles followed, with Kelly Haimona shoving a penalty wide for Zebre.
The first half ended with Oliviero Fabiani barreling through a gap to touch down but the visiting hooker’s route was cleared by an obstruction, picked up by the television review.
With both sides penalised for squint line-out ball soon after the interval and Haimona short with a penalty attempt, an upturn in the quality on show looked unlikely.
But Hidalgo-Clyne’s introduction brought with it some much-needed zip and he threaded a grubber through for Hoyland to run on to and the winger was able to kick it on and win the race for the line.
Soon after, Hoyland was diving over in the corner after Phil Burleigh did well to gather a fizzing high pass from Hidalgo-Clyne.
Tovey converted on both occasions and the fly-half made it three from three when his clever break was supported well by Stuart McInally, with the replacement hooker offloading for Hidalgo-Clyne to waltz through unchallenged.
The chance of a just a second try bonus for the hosts this season appeared to have gone when a late penalty was kicked into touch only for Zebre to rob the line-out.
However, an offside infringement allowed Edinburgh to keep the ball alive and, with the clock red for almost two minutes, a patient passing move was finished off by Toolis.
Edinburgh: Kinghorn, Hoyland, Allen, Burleigh, Brown, Tovey, Kennedy, Dickinson, Ford, Nel, Bresler, B. Toolis, Coman, Watson, Du Preez.
Replacements: Helu for Brown (74), Hidalgo-Clyne for Kennedy (48), McInally for Ford (41), Andress for Nel (73), A. Toolis for Bresler (73), Bradbury for Coman (5). Not Used: Dell, Dean.
Zebre: Van Zyl, Beyers, Boni, Pratichetti, L. Sarto, Haimona, Palazzani, Lovotti, Fabiani, Chistolini, Geldenhuys, Bortolami, Cook, Ruzza, Meyer.
Replacements: Postiglioni for Lovotti (74), Ceccarelli for Chistolini (48), Caffini for Cook (24). Not Used: Roan, Koegelenberg, Burgess, Canna, Bisegni.
Ref: Leighton Hodges (Wales).