Richard Hibbard rumbled over in the first-half but the Welsh region trailed at the interval following a Dougie Fife try and the boot of Phil Godman for the hosts.
But Dirksen pounced for a breathtaking try following the break and the Ospreys hung onto a slender lead to complete a Pro12 double over Edinburgh.
Godman opened the scoring for Edinburgh with a penalty on 14 minutes and the Scottish side quickly surged into an eight-point lead.
Former Scotland full-back Chris Paterson made the initial inroads with some quick foot-work and the ball was recycled and spread to Fife to score on his debut.
Godman failed to add the extras and Biggar chipped into the hosts’ lead with a trademark drop-goal.
The Ospreys continued to fight back and drew level after Hibbard rumbled over from a close-range lineout.
But Edinburgh hit-back with Godman converting a simple penalty to enter half-time leading 11-8.
Alun Wyn Jones, along with Wales squad member Ryan Bevington, was introduced after 49 minutes to make his first appearance since dislocating a toe while training in November.
Godman edged Edinburgh further in front with his third penalty on 54 minutes but the Ospreys quickly responded with a superb try.
Tom Isaacs released Dirksen with a pin-point miss pass and the wing swatted Paterson aside, before chipping over Godman and racing clear.
Godman and Biggar both missed chances to get back on the scoreboard and the Ospreys got out of jail in the final quarter as Edinburgh turned the screw.
After winning a penalty following a dominant five-metre scrum, Edinburgh opted for a re-set, instead of taking the points and they conceded a penalty as the opportunity went begging.
Edinburgh continued to push for a match-winner but the Welsh region demonstrated plenty of guts and determination to hang on.
Â