Defining ‘last’ class on foreach blog posts

Something like this should work for you.

$args = array( 'numberposts' => 3 );
$lastposts = get_posts( $args );
$count = 1;
foreach($lastposts as $post) : setup_postdata($post); ?>

<div id="blog" class="<?php if ($count == 3) : ?>last<?php endif; ?>">
  <div class="blog-header"><a href="https://wordpress.stackexchange.com/questions/34591/<?php the_permalink(); ?>">
    <?php the_title(); ?>
    </a>
    <div class="date">
      <?php the_date(); ?>
    </div>
  </div>
  <?php the_excerpt(); ?>
</div>
<?php 
$count++;
endforeach; ?>