There are several ways that you can argue that Shakespeare and hip-hop are connected.
First of all, they are both written using a musical, lyrical quality. Shakespeare's use of iambic-pentameter gives the words a sort of "beat," much like in hip-hop. The delivery of Shakespeare's characters is spoken with a sort of cadence. This is also evident in hip-hop music. Even without the accompaniment of music, the way the words hit in a particular song cause has a cadence.
As with all lyrics, they are akin to poetry, thus using many literary elements throughout. Shakespeare also instills the use of literary elements throughout his work. One literary element in particular that comes to mind when thinking about both Shakespeare and Hip-Hop music is their implementation of allusion. An allusion is when the speaker or character makes a reference that is universally known or understood. For example, often in Shakespearian plays, characters will reference Greek or Roman gods. If a character said, By Zeus!, everyone (for the most part) knows who Zeus is. In an example of allusion being found in Hip-Hop, in Emmenen's "Lose Yourself," he refers to Salem's Lot. Salem's Lot is a famous book written by Stephen King.
While many parallels can be drawn between Shakespeare and Hip-Hop, the two that first entered my mind were the rhythmical qualities found in both and how they both include literary elements like allusion to help engage the reader.