Alton Sterling was shot in Louisiana on Tuesday after being pinned to the pavement by two white officers.
A Minnesota officer shot Philando Castile dead while he was in a car with a woman and a child, just a day later.
A demonstration against their deaths ended in further tragedy as a sniper opened fire on police officers in the heart of Dallas, killing five officers and injuring six others on Thursday evening.
Jay Z appears to have written the song at least two years ago, as his statement mentions the death of 18-year-old Michael Brown in 2014.
The black teenager was shot dead by a white police officer in Ferguson, Missouri, in August 2014, sparking mass protests and rioting.