I'm assuming that the Sections you refer to relate to the Public Order Act 1986. (There are THOUSANDS of different laws that have Section 5 and 6 within them!).
If so you've got a statutory defence if you were actually inside the house at the time. Quote "An offence under this section may be committed in a public or a private place, except that no offence is committed where the words or behaviour are used, or the writing, sign or other visible representation is displayed, by a person inside a dwelling and the other person is also inside that or another dwelling".
http://www.legislation.gov.uk/ukpga/1986/64
You should consider taking action against the police for unlawful arrest.
Chris