Abstract The biological complexity reflected in histology images requires advanced approaches for unbiased prognostication. Machine learning and particularly deep learning methods are increasingly applied in the field of digital pathology. In this study, we propose new ways to predict risk for cancer‐specific death from digital images of immunohistochemically (IHC) stained tissue microarrays (TMAs). Specifically, we evaluated a cohort of 248 gastric cancer patients using convolutional neural networks (CNNs) in an end‐to‐end weakly supervised scheme independent of subjective pathologist input. To account for the time‐to‐event characteristic of the outcome data, we developed new survival models to guide the network training. In addition to the standard H&E staining, we investigated the prognostic value of a panel of immune cell markers (CD8, CD20, CD68) and a proliferation marker (Ki67). Our CNN‐derived risk scores provided additional prognostic value when compared to the gold standard prognostic tool TNM stage. The CNN‐derived risk scores were also shown to be superior when systematically compared to cell density measurements or a CNN score derived from binary 5‐year survival classification, which ignores time‐to‐event. To better understand the underlying biological mechanisms, we qualitatively investigated risk heat maps for each marker which visualised the network output. We identified patterns of biological interest that were related to low risk of cancer‐specific death such as the presence of B‐cell predominated clusters and Ki67 positive sub‐regions and showed that the corresponding risk scores had prognostic value in multivariate Cox regression analyses (Ki67&CD20 risks: hazard ratio (HR) = 1.47, 95% confidence interval (CI) = 1.15–1.89, p = 0.002; CD20&CD68 risks: HR = 1.33, 95% CI = 1.07–1.67, p = 0.009). Our study demonstrates the potential additional value that deep learning in combination with a panel of IHC markers can bring to the field of precision oncology.