Yes. Either your friend sells you an undivided share of the property. In that case, you will hold ownership rights over the entire parcel jointly with your friend, and will be subject to the rules governing joint ownership (indivision) as set out in Articles 815 et seq. of the French Civil Code. To facilitate management of the property, a notary can draw up a joint ownership agreement (convention d’indivision) in accordance with Articles 1871-1 et seq. of the Civil Code.
Alternatively, your friend may apply to the local municipality for permission to subdivide the parcel (with the assistance of a certified land surveyor). If approved, he can then sell you the newly created parcel containing the garage, of which you will be the sole owner.