The problem you're facing is that font-lock needs special care when handling multiline keywords.
When you first open your file, font-lock does the highlighting in rather big blocks (~500bytes IIRC), but after the buffer has been changed in some way font-lock will by default only rehighlight it line-by-line for optimization reasons, which means that when it'll consider your heading lines its working region won't even include the next line to perform a match.
A quick fix would be to add a hook to font-lock-extend-region-functions
that would extend your rehighlighting region if your special ={5,}.*
line is either the first line of the region or the first line after the region. This is not the only (and probably not the most optimal) way to do it, but it should work.
See Multiline Font Lock Constructs section of EmacsLisp manual for more info.