Drug mode of action (MOA) of novel compounds has been predicted using phenotypic features or, more recently, comparing side effect similarities. Attempts to use gene expression data in mammalian systems have so far met limited success. Here, we built a drug similarity network starting from a public reference dataset containing genome-wide gene expression profiles (GEPs) following treatments with more than a thousand compounds. In this network, drugs sharing a subset of molecular targets are connected by an edge or lie in the same community. Our approach is based on a novel similarity distance between two compounds. The distance is computed by combining GEPs via an original rank-aggregation method, followed by a gene set enrichment analysis (GSEA) to compute similarity between pair of drugs. The network is obtained by considering each compound as a node, and adding an edge between two compounds if their similarity distance is below a given significance threshold. We show that, despite the complexity and the variety of the experimental conditions, our approach is able to identify similarities in drug mode of action from GEPs. Our approach can also be used for the identification of the MOA of new compounds.