So you want 1-2-3 from A4 and 4th and 5th and FD from A8 .
You need to swap the Final drive And secundary shaft from A8 into your A4 .The small gear from Secundary shaft and the Big FD gear need to be together.Also you can change 4th and 5th from your A4 to A8 ,you need to pull off the top gears from the shaft on both secundary and primary shaft .Those 2 shafts work together too.
Here's a picture of a Z6 tranny inside
The biggest gear is the Final Drive ,the tower of gears on the left is the secundary shaft and the tower on the right is the primary shaft.The top gear of the 2 towers is 5th .As you can see there's a 5th gear on the Secundary shaft and on the primary shaft.If you would count the tooth from both gears and divide them with each other you would get the 5th gear ratio of 0.771 from Z6.This works with all the other gears too.You can remove 5th from the secundary and primary shaft and replace them with 5th from a8 .It could be that either 5th gear from Primary or secundary shaft has the same amount of tooth and diameter as your A8 gears have,so you'll only need to swap out 1 gear.But most likely you'll need to swap both.
If you would buy a aftermarket Final drive you'll always get the big gear and the secundary shaft cause both gears have different tooth and diameter to adchieve that different ratio.