If your ls command is aliased to ls -a or ls -A, its output includes two extra items , . and .. , which refer to directory itself . and its parent (..), as well as other files that start with leading . , so there's your difference from 5058 and 5060 files. They don't show up in GUI file manager simply because it's build that way, however most Unix applications are build to recognize the existence of those two.
Additionally, please never use ls | wc -l to count files. Parsing output of ls has a lot of issues, and it's a practice that is generally best to be avoided. If you need to count files in a directory via command line, please see Why does `ls -l` count more files than me? for proper methods.
In this specific case, I'd recommend you use find -maxdepth 1. find prints all of the files and directories, and does not hide those files or directories that begin with leading .