Scott Brown would enter the Massachusetts Senate special election with only a slight lead over the Democratic establishment’s candidate, Rep. Ed Markey, according to a poll released Wednesday by the Democratic firm Public Policy Polling.

But first Markey will need to get past a primary challenge, as Rep. Stephen F. Lynch is poised to formally announce his candidacy on Thursday for the Democratic nomination.

The automated poll shows Brown leading Markey by three points, 48 percent to 45 percent, in a head-to-head contest. Driven in part by name recognition, Markey starts out with a 52 percent to 19 percent lead over Lynch.