Gamma Knife, at the end of the day its no different then using a actual knife vs punching someone.
Actually a real knife might have finished it as Doflamingo would have a hole in his stomach, which does bring up the question of why Law didn't simply use a real knife.
But G4 Luffy is much more efficient at beating Doflamingo as it can actual be used again where Gamma Knife is a attack where you have to catch the person by surprise and if you screw it up its over, as we saw with what Doflamingo did to Law.
Gamma Knife would be useless in combat against someone who didn't drop their guard.
But Doflamingo basically pulled himself back together and shrugged it off, where G4 Luffy isn't even giving him breathing room or a chance to do much before Luffy knocks him through another building.
Also G4 has done so much damage to Doflamingo's ego, the guy looked mad in the latest chapter with Luffy slapping him from one end of the island to the other.
So long story short, Gamma Knife was more damaging in the short term, but G4 Luffy does far more damage in the long term by destroying Doflamingo's ego and its actually far more useful in battle, as Luffy can counter Doflamingo's attacks and beat Doflamingo without giving him time to recover.
Edit: Also its more entertaining.
A bad guy being punched through buildings is far more amusing then being stabbed with a knife.