From my experience as a guitar teacher there are some people who (with some practice) are able to play that chord, and some simply aren't. You're dependent on the size of your hand and especially of the flexibility of your third finger. People who can flex their third finger in the "wrong" direction will find it easier to play that chord. Also your pinky mustn't be too short, otherwise you won't be able to reach the g string after having barred the third fret with your third finger.
So practice and try hard but don't get disappointed if you don't manage because there might be purely physical reasons. I myself do not play that chord like that either. I use the fingering on four strings that you suggested, and if I need that high G note I would switch between the B and E strings with my third finger. If I really need all those notes at the same time, I usually play that chord with the root on the low E string:
Here you have to bar your index on the 7th fret. For me this fingering is much easier to play. But again, it's always your choice how many notes you add to a chord.
Another option that I sometime use is leaving out the root, so I would play
and I would use all four fingers (1 on d, 4 on g, 2 on b, 3 on e).