They are usually interchangeable, but they aren't quite the same meaning. If the team took a joke from a book, wrote it down, and sent a letter with the joke... That's a joke from the guys on the team. It came from them directly, but they didn't necessarily create it originally so it isn't by the guys on the team.
But if the team created the joke, or took an action to do a practical joke like covering a pig in shaving cream and letting it loose in an algebra class, then they it's a joke by the guys on the team. "From" is still fine, though.
If a famous standup comic writes a joke, and somebody else tells it to you then it's a joke by the famous person but usually not from them. It's still correct to say "this joke is from Aziz Ansari's book," but it would be unusual to say, "This joke is from Aziz Ansari" if you never met him. Because you got it from the book, even if it was by Aziz Ansari.