Sunday's 3-1 defeat by Croatia left Ireland staring at an early return home from their first European finals since 1988 but the experienced Sunderland player expects his team to come out fighting even though the odds are stacked against them.
"We've proved it in the past against the top teams and we'll have to do that again," O'Shea told reporters at Ireland's Gydinha training base.
"Our backs will be against the wall for the majority of the game and, normally, that's where we can come out and shine."
Ireland produced a battling display to draw 0-0 in Moscow against Russia last year, a result that went a long way to sealing a playoff spot for the finals.
It was the kind of dogged performance that Ireland have become well-known for under manager Giovanni Trapattoni but European and world champions Spain represent an entirely different challenge.
"The team shape is going to be so important," he said, "We're going to have to keep our shape because they can cut you open. Obviously, the Barcelona trait is very evident through their team.
"We'll have to be on our game but we're confident we can cause them some problems too."
With Italy, who drew against Spain on Sunday, kicking off against Croatia before Ireland play in Gdansk, Trapattoni's men could keep themselves in the hunt for a quarter-final spot with a draw.
But defeat would almost certainly be terminal.
"We'll know afterwards. We'll know how the game [between Croatia and Italy] has gone," O'Shea said.
"We won't say for certain now. We can't lose the game, we know that. We can beat Spain. We're going to need a lot of luck along the way and we're going to have to play better too."
Trapattoni's assistant Marco Tardelli reported a clean bill of health ahead of the game and said the mood was "perfect".
"We are ready for the next match," he told reporters.
"After the upset, the players know - and you know because you saw during training that the players want to play a good match against Spain."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.