i get similar probs when my nsr150 is cold. (just needs to be ridden out - try not to over rev when cold).
u said u have probs when u reach 5000rpm, what about when below that?
a hunch tells me that you are running lean... but u didnt note any over heating problems...?
also check the sparkies to see their condition..
what mods did u do and what wires did u splice??