Figured it out. Anyone who wants to accomplish the same, here is the code necessary to do it:
<?php
$numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
?>
<?php if ( $numcomments ) : ?>
<a href="wp-admin/moderation.php"><?php echo sprintf(__('Awaiting Moderation (%s)'), number_format($numcomments) ); ?></a>
<?php endif; ?>