The source, who declined to be identified because of the sensitivity of the topic, did not disclose the terms of the deals.
Later on Wednesday, Merck said it had been asked by the Commission to be prepared to supply Rebif to EU states "upon request if and when the indication for Covid-19 treatment is adjudicated."
Roche also confirmed talks with the EU.
"In ongoing discussions with the European Commission, Roche has committed to meeting the supply needs for eligible patients with Covid-19 associated pneumonia in the EU, and around the globe, in an equitable and sustainable manner," the Swiss company said in a statement.
A Commission spokeswoman was not immediately available for comment.
Roche is doing a late-stage, 330-patient trial of RoActemra, known as Actemra in some markets, in Covid-19 patents after the anti-inflammatory drug used against rheumatoid arthritis was deployed in China in patients suffering from a severe immune system reaction. Roche said it would share data as soon as possible.
The medicine is also being tested on Covid-19 patients in combination with Gilead's antiviral remdesivir, the only drug so far authorised by the EU for use against Covid-19. Patients are still being recruited, Roche said.
In early June, an Italian trial of Actemra in patients with early-stage Covid-19 showed it failed to help them.
Rebif was developed by Swiss biotech firm Serono before Merck bought the company.
Both drugs target proteins in the body associated with inflammation, and there is some hope they may help severely ill Covid-19 patients suffering from a so-called cytokine storm, an immune system reaction that in can lead to organ failure.
The companies said in letters to the Commission that they could meet demand from EU countries, the source said, declining to name the EU states that had expressed interest in the drugs.
EU countries will now have to agree with the companies on the supplies needed, the source added.
Brussels is also in talks with Gilead to obtain doses of remdesivir for member states and boost its production capacity. It also wants to reserve supplies of vaccines being developed by Johnson & Johnson and Sanofi.
In June, France, Germany, Italy and the Netherlands said they had secured 400 million doses of a potential Covid-19 vaccine developed by Britain's AstraZeneca.
Concerns over remdesivir's availability were ignited after Gilead pledged almost all its output to the United States.