First of all we have to look at the tax treatment of the year 4 transaction, since that was a disposal.
Land was bought for 35k.
Year 4: part of the land was sold for 20k.
Question: What was the market value in year 4 of the remaining part of the land, the part that was not sold? Let's say it was 25k.
So, to calculate CGT due (if any) on the year 4 disposal you aportion the original purchase cost (35k) between the two parts of the land in proportion to their value in year 4. So the acquisition cost of the land that was sold in year 4 is:
35k x (20k/(20k +25k)) = 15,556
So you have a gain accruing in year 4 of €20,000 - €15,556) = €4,444. You should have accounted for CGT on that in year 4. Yes, it's divided equally between the two co-owners. If that wasn't dealt with at the time it's something that will need to be sorted out now. Talk to an accountant about how to manage this at the lowest cost in interest and penalties.
If the acquistion cost of the part of the land disposed of in year 4 was €15,556, then the acquisition cost of the rest of the land, that you've held up to now, is €(35,000 - 15,556 =) €19,444. Assuming the couple held the land as joint tenants (which is the norm for a married couple who co-own property) the surviving member of the couple is now the sole owner of the remaining land, and is treated as having acquired it for €19,444. If they sell it for €40,000 there'l be a chargeable gain of €20,556, with CGT computed accordingly.
Note that all these calculations are based on my assumption that the value of the land that was not sold in year 4 was, at that time, €40k. I plucked that figure out of the air. You'll need to identify the correct figure and plug it into these calculations.