<?php $posts = get_posts('post_type=custom-post-name&posts_per_page=5'); ?>
<?php if (!empty($posts)): ?>
<ul class="className">
<?php foreach ($posts as $post):setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
</ul>
<?php endif; ?>