Restrict query to last day with posts

You need to find the most recent date with posts and use that to construct the $current_ fields.

$last_date = $wpdb->get_var("SELECT DATE(MAX(post_date)) FROM {$wpdb->posts} LIMIT 1");
if (!empty($last_date)) {
    list($current_year,$current_month,$current_day) = explode('-',$last_date);
    query_posts( 
        "cat=5&year=$current_year&monthnum=$current_month&day=$current_day&order=ASC" 
    );
}