Hi thanks for your help. Your last line of code was really beneficial.
I was able to do it with thise code.
<ul>
<?php
$lastposts = get_posts('numberposts=5&orderby=date&cat=-52');
foreach($lastposts as $post) :
setup_postdata($post); ?>
<li<?php if ( $post->ID == $wp_query->post->ID ) { echo ' class="active"'; } else {} ?>>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>