First of all, never use
Note: This function isn't meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with new instance of the query. It is inefficient (re-runs SQL queries) and will outright fail in some circumstances (especially often when dealing with posts pagination).
You should rather use
WP_Query to create custom queries
Secondly, your problem is your
posts_per_page parameter. That is set to
1. What this means is that one post will be retrieved which will come from either cat 1 or cat 5, depending which post is the newest between the two cats. You have to increase
1 to retrieve more posts, set
-1 to retrieve all posts from these two categories.
You can also remove the
posts_per_page parameter and replace it with
nopaging=true to retrieve all posts.