It sound's like you may be describing a rectal prolapse. It can occur from straining (this would be highly unusual for a five week old) but most often in pup's occur's because they have had the run's for whatever reason (parasites, bacteria, overeating in older pups whom have been weaned, even breed in some cases due to their more sensitive systems and propensity to having softer stool's other thing's and combination's of thing's :-) for awhile and have lost the muscle tone. Sometime's it's minor and sometime's it need's to have a couple of stitches to hold the rectum inside the body while thing's are strengthened back up. You should take the pup to your vet (you do NOT want it out there for very long or it may be a big issue) so they can evaluate and do what need's to be done and go over everything in more detail with you. Probably do a fecal to see if it was a parasite that caused the run's. It'll be okay as long as you get it taken care of quickly (insides on the outside can dry out among other problem's). Good Luck.