You obtain the sniper rifle in Mercenaries 2 by completing a specific job for the guerrillas — the mission where you assassinate a VZ officer. As a reward, they hand you the sniper rifle right there.
After that, the contact you did the mission for will also let you buy it, so you can restock it whenever you need one.