When Stanley is having a confrontation with Blanche while Stella is at the hospital delivering her baby, the story of his cousin functions as evidence of Stanley's animal, bestial nature. Stanley has overheard Blanche telling Stella that she thinks of Stanley as coarse and animal-like.
The story also foreshadow's Stanley's rape of Blanche. While telling her the story, Stanley shakes a bottle of beer. When he opens it, the beer shoots out of the bottle in a sexually suggestive gesture. Stanley's disgust with Blanche is about to explode into sexual violence. Like the shaken beer, Stanley will "blow his top."