Bopara followed up his 79 in the first innings with an unbeaten 48 as Essex got to the winning line after being left a modest target of 133.
During an absorbing final day, which saw 17 wickets fall for 224 runs on a pitch which gave the spinners plenty of help, Bopara showed the qualities and patience needed to inflict a first championship defeat of the season on Hampshire.
Even when wickets were tumbling around him he refused to panic, combining solid defence with an ability to wait for the right ball to attack. There were not too many loose deliveries on offer but when they did arrive, he helped himself to seven fours and two sixes.
Coming in after the fall of the first wicket, when Nick Browne gave left-arm spinner Liam Dawson the charge and was stumped, Bopara watched Tom Westley, Jesse Ryder and James Foster depart in the space of five overs as Essex slumped to 29 for four.
— Ravi Bopara (@ravibopara) July 16, 2014
All of them were victims of spinner Danny Briggs, who conceded three boundaries to Ryan ten Doeschate before bowling the all-rounder to add to his tally.
Greg Smith and Tim Phillips were then removed by Dawson, both snapped up at slip by Sean Ervine, to leave Essex still requiring 53 with only three wickets remaining.
Graham Napier, with three boundaries in his 19, carried Essex to 108 before driving Dawson to Matt Coles at mid-off to ramp up the tension.
Bopara struck Briggs for a six and four in an over to relive the pressure, leaving Sajid Mahmood to see his side to their target with two successive boundaries against Dawson.
In the morning, Hampshire quickly lurched from one disaster to another after they had resumed 44 ahead on 83 for one.
Medium-paceman Ryder delivered a crucial blow with three wickets, which included Michael Carberry - who carried his overnight score to 56 before edging to Phillips in the slips.
Left-arm spinner Monty Panesar then removed Dawson and Adam Wheater, paving the way for off-spinner Smith to bring the innings to a swift conclusion with four wickets in 12 deliveries at a cost of only three runs.
Among them was Coles, who emphasised that attack was the best form of defence as he helped himself to three sixes and as many fours before holing out on the long-off boundary for 36.
A boundary from Mahmood finishes it - Essex have beaten Hampshire by two wickets. Not the result we wanted but a great fightback! #LVCC
— Hampshire Cricket (@hantscricket) July 16, 2014
Hampshire were left reflecting on a modest total of 171 as Smith finished with 4-46, Ryder 3-31 and Panesar 2-53.
In the end, however, it was Bopara who earned the major plaudits as Essex gained a measure of revenge for the 470-run thrashing they suffered against Hampshire last month.
Briggs and Dawson each finished with four wickets at a cost of 61 and 58 respectively - but their efforts proved in vain. Essex took 21 points and Hampshire four .
Essex head coach Paul Grayson said: "It was a superb victory against the odds. At the start of the day, our chances of winning were very slim indeed but we bowled well to give ourselves a chance.
“Mind you, we did panic a bit in our quest but in the end Ravi Bopara showed what a class player he is to see us home."
Hampshire captain Jimmy Adams said: "It was a fantastic game of cricket, to get so close is bitterly disappointing from our perspective but it was a really good game especially if you were an Essex supporter or a neutral really.
"When we batted, we were probably 50 runs shy of what we needed."