If I understood your problem correctly, this is what I'd do: I'd split Task A into A1 and A2. A1 would have a planned duration value of x and A2 of y, where y represents the remaining duration that should finish within the five months of starting Task B. I would split task B into B1 and B2. When A1 finishes, both A2 and B1 starts. Both A2 and B1 will have a FS with B2. A2 and B1 should finish at the same time, i.e., they have the same planning duration, but if either slips then B2 start goes out.
If I completely misunderstood, clarify and then I'll try again.
If I understand the problem correctly, my solution would be to split task A into 2 components: Procurement and Delivery. Procurement would have a short duration - in the illustration below I have given it 1 day - while delivery would be 2 months, representing the time taken for the supplier to deliver the component. By creating a Start - Start relationship between Task B and Task A Procurement, you show the start dates being aligned. By then creating a Finish - Finish relationship with 4 months gap, you can force Task A Delivery to finish 4 months before Task B finishes. You could also show it another way, using a Start - Finish relationship between Task B and Task A Delivery... I have shown this on the example below as Task C.