The 1992 Olympic champions were already 1-0 down when they had Inigo Martinez sent-off with five minutes remaining in the first half and they failed to recover from their numerical disadvantage.
Keigo Higashi, Kensuke Nagai and Hiroshi Kiyotake all went close for Japan after the break but a single goal was enough to send them to the top of the group following Honduras and Morocco's 2-2 draw earlier in the day.
Spain started the game by trying to impose their usual possession-based style on the game, but they were hustled from the very first whistle by an energetic Japanese team.
Chelsea's Juan Mata forced Shuichi Gonda into a fine save with Spain's only serious effort of the first half but it was Japan who were threatening more regularly and they were rewarded after 33 minutes when Otsu outmuscled Martin Montoya to prod home Takahiro Ohgihara's corner.
Kiyotake should then have doubled the lead as he pounced on a wayward backpass from Alvaro Dominguez but, after rounding David De Gea, he could not turn his shot on target from a narrow angle.
Spain were in trouble a few moments later when Martinez was sent-off for bringing down Nagai just outside the area.
Japan wasted a host of opportunities to extend their lead early in the second half.
De Gea was called into action to make a fine save from Higashi in the 49th minute and the Manchester United goalkeeper should have been left helpless when Nagai broke through on goal soon after, only for the striker to pull his shot just wide of the target.
Kiyotake had an almost identical opportunity two minutes later at the end of an amazing solo run, but again his shot flew just wide.
By contrast, Spain struggled to create their own clear-cut openings. Jordi Alba's effort was easily smothered by Gonda with 12 minutes remaining before Spain were again thankful to De Gea as he made a stunning stop to once again deny Nagai and Hotaru Yamaguchi shot wide with the goal at his mercy in stoppage time.
Japan boss Takashi Sekizuka was understandably delighted with his side's performance but refused to get too carried away.
He said: 'This is still the first match and we still have far to go to even make the knockout round, but I look forward to playing Spain again later in the competition.'
Spain manager Luis Milla said afterwards: 'Despite the result, playing in the Olympics is a once-in-a-lifetime opportunity and we have to enjoy it.
'At this level we know the small details count and now we have to work on those and prepare for the next match against Honduras. We have two finals now to try and qualify for the next stage.'