The only thing that can be said for certain is that Doffy > Luffy.
That doesn't mean Doffy > G4 as the title implies.
G4> a weakened Doflamingo because well... Look at the last 2 chapters. Donflamingo was on the defensive pretty much the entire time, and the only attack he landed did nothing to a G4 Luffy. That technique was way above what Donflamingo could handle in his weakened state, and if the time limit didn't run out, Luffy would have won.
However, it is uncertain if G4 > a healthy Donflamingo since we didn't get to see much of what that was like since a lot of it was off paneled with his fight with Law. At best I would say G4 = Healthy Doffy.