The two MPs, both from the minority Tamil community, joined the United People's Freedom Alliance (UPFA) led by Rajapakse, who oversaw the military offensive in which troops defeated separatist Tamil Tiger rebels last year.
Rajapakse won a second presidential term in January elections and consolidated his power in parliamentary elections in April.
After the defections, his ruling alliance was just four seats short of the two-thirds majority needed to change the constitution to allow him to stand for a third term in office.
Three other legislators are already informally backing the government and are expected to defect soon.
Rajapakse has strengthened his grip on power since victory over the Tigers last May brought to an end to decades of bloody civil war.
Several of his family hold key positions within the government, and he has repeatedly denied crushing political dissent on the island.
Sri Lanka's key aid donors, including the United States and Japan, have pushed Ra