If by "gun" you mean "crude hand cannon", then they won't even need any wire (well, maybe as a tool for scraping or cleaning the inside of the barrel, but not as raw materials). If you mean a xaser rifle or a P90, you're definitely going to need either some nanobots (or something equivalent or better) or proper facilities and materials.
On the other hand, you probably actually could improvise a crude coilgun/Gauss Rifle with some molds, a lot of wire, and some scrap metal (you'd need the projectiles to be ferromagnetic, and the weapon iteslf not), or a crude railgun (though the rails will probably be only good for one or a few shots before needing repair or replacement unless they were cannibalized from your crashed ship), if you had the appropriate skills, and then you'd just need a power (voltage) source. It is also worth noting that given a basic understanding of electricity and magnetism, a dozen or two car batteries, and either two conductive rails and some conductive projectiles or a long tube, a spool of low-gauge wire and some ferromagnetic projectiles, could make a crude railgun or coilgun, respectively - I could probably make one in real life with these parts; as for the power of the weapon, well, I won't be abe to give any numbers until I get my hands on a decent numerical integration tool (since the rails have finite length), but I HIGHLY doubt it would do more than scratch the paint of unshielded power armor)
Edit: I just remembered the open computer lab in the Math building, and I plan to crunch some numbers after class to get some numbers for muzzle velocity vs. current, railgun length, projectile mass and gap/projectile width (note that the projectile mass does not affect the kinetic energy of the projectile, only its speed).