Assuming the iframe is a web page, your content script that runs inside should
initiate port-based messaging via chrome.runtime.connect. The background script can send the data back by using port.postMessage inside its chrome.runtime.onConnect listener. If necessary, you can also store the port in a global variable to be used in other listeners while the background script is alive.
There's also an elaborate solution for binary data (e.g. typed arrays, blobs, array buffer): the content script transfers a MessageChannel port via parent.postMessage, the side panel transfers it further via navigator.serviceWorker messaging to the background script's self.onmessage listener. Note that to avoid abuse from the web page you might want to use a random id as the message body, which you can store in chrome.storage.session or send explicitly from the content script to the side panel via chrome.runtime.sendMessage.