Custom search data to UILayout.prop_search
Use a pointer property with a poll.
To distinguish a regular material from one for a gp object there is the handy attribute Material.is_grease_pencil
Similarly to https://blender.stackexchange.com/a/159155/15543 and using a poll method https://blender.stackexchange.com/a/101303/15543
Will narrow down the selection based and offer the same choices as the regular material drop down.
import bpy
from bpy.props import PointerProperty

def poll_material(self, material):
    return not material.is_grease_pencil

class TEST_PT_layout_panel(bpy.types.Panel):
    bl_label = &quot;Prop Panels&quot;
    bl_category = &quot;Test Panel&quot;
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = &quot;scene&quot;

    def draw(self, context):
        scene = context.scene
        layout = self.layout
        
        col = layout.column()
        col.prop_search(scene, &quot;prop&quot;, bpy.data, &quot;materials&quot;)
        #or 
        col.prop(scene, &quot;prop&quot;)


def register():
    bpy.types.Scene.prop = PointerProperty(
        type=bpy.types.Material,
        poll=poll_material,
        )
    bpy.utils.register_class(TEST_PT_layout_panel)


def unregister():
    bpy.utils.unregister_class(TEST_PT_layout_panel)
    del bpy.types.Scene.prop
    
if __name__ == &quot;__main__&quot;:
    register()

Kinda related:
How to populate UIList with all material slot in scene? 2.8