The BJP wrested the seat from the main opposition INLD, which was decimated in the by-election.
Middha won by a margin of 12,935 votes, Jind Deputy Commissioner-cum-Returning Officer Amit Khatri said.
JJP was floated last month by Hisar MP Dushyant Chautala after a split in the INLD following a family feud.
The Congress, which had fielded its senior leader Randeep Singh Surjewala, an MLA from Kaithal, ended up at the third spot.
Middha (48) is a BAMS doctor, whose father’s death necessitated the bypoll.
Meanwhile, Congress candidate Shafia Zubair won the Ramgarh assembly poll in Rajasthan by defeating her nearest BJP rival Sukhwant Singh by a margin of 12,228 votes, officials said.
With this, Congress’s tally has increased to 100 in the 200-member Rajasthan assembly. Its ally — RLD — has one seat thus the government is in a comfortable position.
Zubair got 44.77 percent votes by securing 83,311 votes while Singh secured 71,083 votes, the officials of the Rajasthan election department said.
BSP candidate and former union minister Natwar Singh’s Son, Jagat Singh, was third. He secured 24,856 votes, they said.
In total, 20 candidates contested the Ramgarh election on January 28.
The election to the assembly seat could not be held along with other constituencies due to the death of the BSP candidate ahead of the Rajasthan elections held on 7 December.