AI wont declare war on someone(A) just because they are allied to someone(B) who the first someone(A) went to war with.
Its supposed to push their belli against the declarer though,from slightly if they had justification to extremely so if they didnt.
This push combined with other factors can cause your ally to declare war ,but its far from a guaranty.Especially since the AI usually waits til it has justification before declaring war.
If your ally shares a border with your new enemy,you can help them decide to declare war.
You simply move some of you units,artillary works best,into your allies territory along its border with your enemy and have them attack from there.
This tends to draw counter-fire,which will of course be landing in your allies territory.
Which often does the trick
Dont expect anything brilliant from the AI.Including positioning before a declaration.Its sadly just doesnt know to do such things.
Hopefully in sr2020 we will see much more from the AI including things like that and group usage etc.....