EXCLUSIVE

Delta Airlines missed a needle that was left in a seat pocket, and an unsuspecting guest got stuck by it -- leading to a year of HIV testing ... according to a lawsuit.

In docs, Gabriel Ybarra says he was flying from LAX to Atlanta in 2015 when he reached into a seat pocket to grab his wallet, and got stabbed by the needle. He says he had to pull the needle out of his right middle finger, which started "bleeding profusely."

Ybarra says "his life flashed in front of him." When he went to a doctor he says he had to undergo a battery of tests, and take powerful meds to ensure he didn't contract anything, especially HIV.

According to the suit, obtained by TMZ, he says the meds caused months of dizziness, headaches, body aches and "explosive diarrhea." He also says he couldn't perform "his duties as a husband to his wife for months."