We study the layer-by-layer (LbL) deposition of a pair of strong polyelectrolytes within the nanopores of track-etched membranes, for pore diameters ranging from similar to 50 to 850 nm. The end-to-end distance of the polyelectrolyte chains in solution was varied from 10 to 50 nm by selecting polyelectrolytes of low and high molar mass and by playing with ionic strength. On flat model surfaces, a linear growth is obtained for all probed conditions and the growth increment is independent of molar mass and substrate nature. When LbL assembly is performed within nanopores, a very different picture of growth emerges, with increments of thickness per cycle of deposition being much larger than on flat surfaces (by factors as large as 100 in some cases), and no significant dependence on molar mass or ionic strength. These observations indicate that polyelectrolyte complexation occurs within a dense gel filling the whole nanopore, resulting from entanglement of the chains which are in a concentrated regime when passing in the confined space of the pore; upon drying, the gel collapses in a tube of wall thickness roughly proportional to its diameter. By using polyelectrolytes of lower molar mass, pore diameters as small as 50 nm could be filled, opening opportunities for the facile fabrication of LbL nanowires of very large aspect ratio.