Edinburgh fly-half Godman scored 12 points for the hosts
Edinburgh (7) 17
Tries: Godman, Ford
Cons: Godman 2
Leicester (9) 12
Pens: Goode 4
Last-year's runners-up Leicester are out of this year's Heineken Cup after Edinburgh handed them their third defeat of the pool stages.
The Tigers led 9-7 at half-time through three of Andy Goode's four penalties.
But the hosts, who crossed in the first half through fly-half Phil Godman, hit back strongly with hooker Ross Ford scoring their second converted try.
Godman then added a penalty to leave Leicester, two-time champions, out of this season's competition.
Leicester looked the hungrier outfit in the early exchanges and it took them only three minutes to get off the mark.
A towering up-and-under by Geordan Murphy sparked panic among the home ranks and captain Ally Hogg was caught offside after Hugo Southwell dropped the kick.
Goode was left with the easiest of penalties to edge his side in front and he doubled the lead after 10 minutes.
Edinburgh replied in positive fashion by launching a series of raids, with Nick de Luca and Ben Cairns to the fore.
But it took until the dying stages of the half before Edinburgh managed to break down the Tigers' defence, despite being down to 14 men after lock Ben Gissing was sent to the sin-bin for an off-the-ball incident.
Gissing's departure seemed to inspire the hosts and Godman discovered an extra yard of pace to snap up a classic fly-half's try, dashing through a midfield gap close to the line.
He slotted the conversion but, predictably, Leicester stepped up the pace in stoppage time and Goode edged them back in front with the last kick of the half.
Edinburgh came out with all guns blazing after the restart, with the Tigers getting the benefit of the verdict when the ball was held up over their line.
But their luck ran out two minutes later as England hooker George Chuter was yellow-carded for killing the ball in the shadow of his own posts.
Godman chipped over the easy penalty to give Edinburgh a 10-9 lead and although Goode put the visitors back in front with 30 minutes to play, the hosts scored the decisive try just before the hour mark.
Edinburgh had been pinned back for a prolonged spell but De Luca and Simon Webster featured in a slick and imaginative handling move which paved the way for hooker Ford to plunge over.
Godman converted from wide out and they had a lucky escape when All Black inside centre Aaron Mauger let the ball squirm from his grasp close to the Edinburgh line.
Goode was then penalised for holding on following a marvellous cover tackle by Hugo Southwell as Edinburgh moved to within a point of the Tigers at the foot of the table.
Edinburgh coach Andy Robinson:
"It was one of the best performances since I came to the club and the fact that it was against one of the strongest teams in Europe made it all the more special.
"There was no problem getting the guys lifted in the build-up to the game - every time they pull on an Edinburgh jersey now it is a crucial game.
"They understand that it is a question of being a professional, knowing the importance of every match. It is a question of performing every time.
"The crowd also made a tremendous difference. The players know if they make a mistake, they will keep on backing them."
Leicester coach Marcelo Loffreda:
"The priority was to get a win with the hope that the contest would open up later on.
"We had three penalties in the last 10 minutes, yet didn't go for goal with a single one.
"If we'd kicked a couple of goals we could have put pressure on and the result might have been different."
Edinburgh: Southwell, Cairns, De Luca, Houston, Webster, Godman, M Blair, Jacobsen, Ford, Kerr, Mustchin, Gissing, Reid, Rennie, Hogg.
Replacements: Kelly, Allori, Hamilton, MacDonald, Meyer, D Blair, MacRae.
Leicester: G Murphy, J Murphy, O Smith, Mauger, Varndell, Goode, Laussucq, Ayerza, Chuter, White, L Deacon, Kay, B Deacon, Croft, Corry.
Replacements: Kayser, Moreno, Wentzel, Crane, F Murphy, Humphreys, Hipkiss.
Referee: Peter Fitzgibbon (Ireland)