How to track post number on the_loop

This should do it:

$real_current_post = $wp_query->current_post + 1;
switch( $real_current_post ){
  case 2:
    // Do something for 2
    break;
  case 5:
    // Do something for 5
    break;
  case 7:
    // Do something for 7
    break;
}

You may need to globalize $wp_query, but as long as you’re using the normal template hierarchy, it should already be in scope. If you do use global $wp_query;, use it before the loop starts.