You have be on a DMap with THE LEVEL NUMBER being 1-8. It has nothing to do with Dmap numbers themselves, just the level number.

Anyway whistle warps. There's a variable that remember the last level warped to using the whistle. It starts at 1 and when you whistle warp successfully it'll either increase or decrease depending on the direction Link is facing when he blew the whistle.

I think it's Right and up is increase and left and down is decrease. So if you last whistle warped to Level 5, you have completeing Levels 1-5 and you use the whistle facing right you'll warp to Level 1.

EDIT: Erm you are not correct about the Big Triforce pieces theory. It will only warp you based on the Level number used. So if you used 1 it will only warp you to WW 1even though the Level 5 five triforce piece is filled.