We present a simple, non-lithographic method for electrically connecting nanowires with electrodes on planar as well as non-planar microsystems. A rigid nanowire is used as a local shadow mask during deposition of metal contacts, which we use to contact structures of widely different conductances: Multiwalled carbon nanotubes, para-hexaphenylene nanofibers, as well as indium arsenide and indium phosphide nanowires. Finally we demonstrate how the method can be extended to different electrode materials on each side of the electrode gap, as well as for investigation of the electromechanical properties of a nanowire integrated in a cantilever.