jon92 Hi again.
OK Plastic, good because it is far, far easier to work with.
First, I would as carefully cut into the top surface, remember you will have to replace this surface, so if you can keep the cut as square and aesthetic as you can, as an aside, what is the top surface?
The area of the cut above will have to be a space large enough to complete the repair.
Excavate the earth away, leaving for the moment the pipework both above and below ground in place, if you cut the Down pipe now it will loose a lot of stability when excavating below ground.
One tip try to find a makers name on the pipework makes fitting new bits easier so use the brand name on your pipes.
If possible, excavate down to the "bend" which is the transition between the Down pipe and the sloping underground drain, with luck this "bemd" will be between 300.mm and 600.mm below ground, I have seen them over a meter underground.
Clear away as much as you can of the earth, to allow you to see the down pipe into the "bend"
Now you can cut the Down pipe, I would suggest that this cut, keep it as square and level as possible about 50.mm to 75.mm above ground, a hack-Saw will do this.
Restrain the pipe above the one you have just cut, if you do not then that pipe can fall out at you.
Remove the cut pipe and clear it.
Next remove the underground pipe and clear that.
Now for the measuring bit, get your new gully and measure from top surface to the inner stop for the pipe fitting, if you can cut the pipe square, to get the fit between pipe and new Gully, assemble the old pipe plus the Gully and see how it fits as regards ground level and the top lip of the Gully.
But? If I were to fit the Gully, I would drop the lip [top] level of the gully below the level of the top surface, why? because when you finish off the top surface you should using a fine concrete run the concrete down wards towards the top lip of the gully, it assists in getting any spilled water to run into the Gully.
One final thing. if it starts to rain whilst you are undertaking the work make provision for diverting the rain water coming down at you in the Down Pipe, you can temporary refit the cut Down Pipe, but shed the water well away from the excavation!
Ken.