Moroccan striker Abdessalam Benjelloun came off the bench to score the winner for Hibs as they dented Hearts’ hopes of Champions League qualification.
The visitors’ line-up had again been controversial, with Rudi Skacel and Edgaras Jankauskas both dropped and Andy Webster, who was refusing to sign a new contract, once again left sitting in the stand.
Jose Goncalves and Takis Fyssas were out injured, so in came Ibrahim Tall and Lee Wallace, Deividas Cesnauskis and Calum Elliot for Valdas Ivanuaskas’ side.
Hibs, themselves chasing a Uefa Cup place, were without Kevin Thomson, the playmaker was ill and replaced by Ivan Sproule.
Hearts had demolished their rivals 4-0 at Hampden Park less than three weeks previously in the semi-final of the Scottish Cup, yet it was their hosts who, following a typically frantic start, took the lead after 14 minutes.
Hibs midfielder Jay Shields robbed a hesitant Paul Hartley in midfield, with the ball breaking to Sproule on the right.
The Irishman drove his cross to the back post, where Derek Riordan took a touch before brilliantly rifling his right-footed shot from 16 yards past Craig Gordon and into the far corner of the net.
A great tackle by Hartley prevented Riordan grabbing a second soon after, before Steven Fletcher volleyed a Shields cross over the bar from close range.
But, with seconds to go in the first half, the visitors drew level with a bizarre goal.
Czech striker Roman Bednar chased a long through ball from Robbie Neilson after Hibs captain Gary Caldwell seemed to have shepherded the ball back to goalkeeper Zbigniew Malkowski.
However, the ball slipped from the keeper’s grasp, allowing the big striker the easiest of tasks to slip the ball into the empty net.
That appeared to inspire Bednar, who came close immediately after the break, twice firing just wide of the post.
Hearts were creating more chances and Bruno Aguiar was inches wide of the target with a speculative attempt from 30 yards.
Senegalese defender Tall then rose unmarked in the home box but headed wide following a fine Hartley cross.
Hibs boss Tony Mowbray brought on Paul Dalglish and Benjelloun and they combined to put his side in front against the run of play, the Moroccan driving the ball home from 16 yards.
Substitute Skacel almost caught out Malkowski with a quickly-taken free-kick late on, but Hibs held on for victory.
Hearts would close out the season in second place, securing qualification for the Champions League – a point ahead of Rangers in third spot. Hearts would also win the Scottish Cup in 2006, famously beating Gretna on penalties at Hampden Park.
Hibs ended their season in fourth, also qualifying for Europe in the form of the Intertoto Cup. They won their first round tie against Latvian side Dinaburg, before going out on away goals to Odense Boldklub of Denmark despite a 2-1 win at Easter Road.
Hibs: Malkowski, Whittaker, Murphy, Hogg, Caldwell, Shields, Glass, Konde, Sproule, Fletcher, Riordan
Hearts: Gordon, Neilson, Tall, Berra, Wallace, Cesnauskis, Hartley, Aguiar, Mikoliunas, Bednar, Elliot