In what country? What was the situation where a 5 year old can be sent to jail?
Nonetheless, a 5 year old (or anyone, for that matter) can easily consent to sex. Just not without getting permission from the powers that be. Not that THAT matters. Kids have sex anyway. They just have to be careful about the powers that be. Just as you do. Just as I do. Try going to a restaurant with a lady friend (a legal and very much consenting one, I mean) and proceed to perform cunnilingus upon her. See if the powers that be will very upset. Then, taker her somewhere where the powers that be won't object, and finish satisfying her.
Keep that concept in mind whenever you have to consider the powers that be.