Five is not close enough. The best way is to pass their influence level. If they have 20% and you have 22% you want to bring their influence over yours. Or if they already have more you want to bring yours over theirs. Either way there is a chance to start pending a war on the next tick. (The tick is the BGS activity/influence resolution that happens once a day. Check the relevant sticky for best guess on the time.)
Note I said a chance. If either faction is in a conflict or pending conflict in another system there will be no war.
The war will pend for three days.