Prostate cancer (PCa) is one of the most common malignancies for males, but very little is known about its pathogenesis. This study aimed to identify novel biomarkers associated with PCa prognosis and elucidate the underlying molecular mechanism. First, The Cancer Genome Atlas (TCGA) RNA-sequencing data were utilized to identify differentially expressed genes (DEGs) between tumor and normal samples. The DEGs were then applied to construct a co-expression and mined using structure network analysis. The magenta module that was highly related to the Gleason score (r = 0.46, p = 3e–26) and tumor stage (r = 0.38, p = 2e–17) was screened. Subsequently, all genes of the magenta module underwent function annotation. From the key module, CCNA2, CKAP2L, NCAPG, and NUSAP1 were chosen as the four candidate genes. Finally, internal (TCGA) and external data sets (GSE32571, GSE70770, and GSE141551) were combined to validate and predict the value of real hub genes. The results show that the above genes are up-regulated in PCa samples, and higher expression levels show significant association with higher Gleason scores and tumor T stage. Moreover, receiver operating characteristic curve and survival analysis validate the excellent value of hub genes in PCa progression and prognosis. In addition, the protein levels of these four genes also remain higher in tumor tissues when compared with normal tissues. Gene set enrichment analysis and gene set variation analysis for a single gene reveal the close relation with cell proliferation. Meanwhile, 11 small molecular drugs that have the potential to treat PCa were also screened. In conclusion, our research identified four potential prognostic genes and several candidate molecular drugs for treating PCa.