Using first-principles density functional theory, we have investigated the electronic and magnetic properties of recently synthesized and characterized 5d double-perovskites Sr2BOsO6 (B=Y, In, Sc). The electronic structure calculations show that in all compounds, the Os5+ (5d3) site is the only magnetically active one, while Y3+, In3+ and Sc3+ remain in nonmagnetic states, with Sc/Y and In featuring d0 and d10 electronic configurations, respectively. Our studies reveal the important role of closed-shell (d10) versus open-shell (d0) electronic configurations of the nonmagnetic sites in determining the overall magnetic exchange interactions. Although the magnetic Os5+ (5d3) site is the same in all compounds, the magnetic super-exchange interactions mediated by non-magnetic Y/In/Sc species are strongest for Sr2ScOsO6, weakest for Sr2InOsO6, and intermediate in case of the Y (d0), due to different energy overlaps between Os-5d and Y/In/Sc-d states. This explains the experimentally observed substantial differences in the magnetic transition temperatures of these materials, despite of an identical magnetic site and underlying magnetic ground state. Furthermore, short range Os-Os exchange-interactions are more prominent than long range Os-Os interactions in these compounds, which contrasts with the behavior of other 3d-5d double-perovskites.