Background: Information about prescription medications prior to death by suicide may help us understand the role of medications, illness and service contact in suicide. Aims: Through the use of a novel dataset, this study aims to provide an improved understanding of the relationships between pain medication and mental health medication, suicide and area level deprivation. Methods: Data was included on all deaths by suicide in NI (Northern Ireland) between 1/1/2012 and 31/12/2015. Each death was matched to 5 live controls, based on age (the closest match within 2 years) and gender, resulting in a dataset consisting of 6630 individuals. Four data sources were linked to obtain the final dataset. Results: Suicide linked with and deprivation, with a heightened risk of suicide for 9 months after last prescription of pain medication and for up to two years after last prescription of mental health medication. Odds ratios for death by suicide were strongest among those with the most recent prescriptions (within 0–3 months) (OR for death by suicide = 12.20 amongst those with mental health prescription medication; OR for death by suicide = 3.69 amongst those with pain medication). These figures support the associations between suicide and pain related conditions, and physical health difficulties. Recent prescriptions are particularly important. Limitations: Received medication prescriptions may not have been taken as recommended. Conclusions: Contact with a clinician to obtain a prescription may present opportunities for intervention. Suicide assessment (and evidence-based suicide specific treatments) may be important for people who are receiving prescribed medication, particularly for a mental illness.