The Atletico Madrid forward, who worked under Mourinho at Chelsea, twice levelled the scores for La Roja in the World Cup Group B game before being withdrawn in the 77th minute.
"I have to say that for me there was a game with Diego Costa and a game after Diego Costa," the Portuguese coach told RT.
"The game changed [when he went off]. For the first time, the Portuguese central defenders they were able to come up, they were not afraid of space behind them.
"They were more confident, they brought the team up. The team became more compact in the last 10 or 15 minutes, and then the free kick situation arrived."
Costa has won 21 caps for Spain, scoring nine goals.