With two out in the fifth, Robert Person walked the bases loaded before allowing O'Leary's single up the middle that gave Montreal a 4-2 lead.
The Expos added four runs with two out in the eighth off reliever Jose Santiago. Michael Barrett delivered a two-run single and pinch-hitter Wil Cordero belted a two-run homer, the 100th of his career.
Ohka (8-4) allowed three runs -- one earned -- and three hits in six innings for his second win of the season against Philadelphia.
Person (3-5) surrendered four runs and four hits in five innings, walking four and striking out three.