I just tried it using the "class" dojo attribute, and unlike you got it to work:
Here's the name picker's xml code:
<xe:namePicker id="namePicker1" for="inputText7">
<xe:this.dataProvider>
<xe:dominoNABNamePicker></xe:dominoNABNamePicker>
</xe:this.dataProvider>
<xe:this.dojoAttributes>
<xp:dojoAttribute name="class" value="myDlgClass">
</xp:dojoAttribute>
</xe:this.dojoAttributes>
</xe:namePicker>
This references a styleClass from a .css resource attached to the Xpage.
As you can see in the screenshots the class is attached to name picker's content widget, and it does work , too.

I don't know whether this method has an advantage over the other one recommended by Peter but maybe it can come in handy one way or another.